views:

48

answers:

2

This is as weird as it gets. Name given in XmlArray attrib's ElementName appears in WISDL but not in actual response. Running under 3.5 (2.0.50727 for IIS AppPool).

After more detailed digging -- autogenned WSDL has different declarations for POST/GET vs SOAP responses and the diff is that they just reference the autogenned elem/type for array and not the whole response type/elem which has new name.

The question still remians - WHY is this happening and more importantly how to fix it?

Here are the Details:

WebMethod:

    [WebMethod]
    [return: XmlArray(ElementName = "TickTick")]
    public TTickerItem[] GetActiveTickerItems2(uint version, uint language, uint locale, int startIndex, int maxItems)

In WSDL:

<s:element name="GetActiveTickerItems2Response">
  <s:complexType>
    <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="TickTick" type="tns:ArrayOfTTickerItem" /> 
    </s:sequence>
  </s:complexType>
</s:element>

<wsdl:message name="GetActiveTickerItems2SoapIn">
  <wsdl:part name="parameters" element="tns:GetActiveTickerItems2" /> 
</wsdl:message>
<wsdl:message name="GetActiveTickerItems2SoapOut">
  <wsdl:part name="parameters" element="tns:GetActiveTickerItems2Response" /> 
</wsdl:message>

Auto-genned test page shows examples with new name (TickTick).

Actual Response:

<ArrayOfTTickerItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/"&gt;
<TTickerItem>
  <m_message>New Ticker 1st Message</m_message> 
  <m_priority>2</m_priority> 
  <m_messageType>0</m_messageType> 
  <m_data1>0</m_data1> 
  <m_data2>13</m_data2> 
</TTickerItem>
. . . . . . . .
</ArrayOfTTickerItem>

Slightly different declarations for GET/POST - misses the new name:

<wsdl:message name="GetActiveTickerItems2HttpGetOut">
  <wsdl:part name="Body" element="tns:ArrayOfTTickerItem" /> 
</wsdl:message>
. . . . . . . 
<wsdl:message name="GetActiveTickerItems2HttpPostOut">
  <wsdl:part name="Body" element="tns:ArrayOfTTickerItem" /> 
</wsdl:message>

It can still be the matter of some settings, part of web.config (I have just plain add name="HttpGet" and HttpPost under //system.web/webServices/protocols xpath which has always been enough) ...

A: 

Have you tried updating the web reference in your asp.net project?

citronas
There's no web reference involved - server code gets build and xcopy deployed - VS doesn't get any info about it, andthe test page is the one that's autogenned by ASP.net, like http://localhost/MyVroot/MyWS.asmx, http://localhost/MyVroot/MyWS.asmx?WSDL, http://MyBox/MyVroot/MyWS.asmx?op=GetActiveTickerItems2 etc. etc. so I'm looking at actual response XML in IE
ZXX
A: 

I'm afraid I'll have to close this one as a bug in ASP.NET since I have consistent repro and no one said that it worked with their setups. Will keep it on for a few more days, just in case.

ZXX
@ZXX: if you consider it to be a bug, then please file it at http://connect.microsoft.com/visualstudio/. It would more likely be a bug in the XML Serializer, however, in which case it will very likely never be fixed.
John Saunders
Part of this might be connected with the question of different treatment of HttpGet serving - notice that the attrib is on the web method, not on a class - the attrib is attached to web method's record in reflection tables so XmlSerializer doesn't even see it unless something above it or after it points finger so to speak. I know that part coz' that where our custom binary serializer finds his goodies :-)So it probably goes back to the issue of GET request being processed differently. No VS in sight - just CLR.
ZXX