Re: Proxy class not reading data returned in SOAP response
From: Jared Jensen (jaredljensen_at_hotmail.com)
Date: 04/28/04
- Next message: Paolo Liverani: "Re: webservice concurrency"
- Previous message: T.U.F.F.: "Special treatment on Netscape browsers (disadvantage)"
- In reply to: Jared: "Re: Proxy class not reading data returned in SOAP response"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 28 Apr 2004 14:03:08 -0700
jaredljensen@hotmail.com (Jared) wrote in
news:3264d672.0404281117.2936771b@posting.google.com:
> "Dino Chiesa [Microsoft]" <dinoch@online.microsoft.com> wrote in
> message news:<#ApeU7OLEHA.1120@TK2MSFTNGP11.phx.gbl>...
>> yes, I think you need to set your RequestNamespace and
>> ResponseNamespace to "Some API"
>> not http://tempuri.org.
>>
>> -Dino
>>
>
> Dino,
>
> I've updated the method attributes as shown below. I tried it with
> and without setting the "ResponseElementName" param. It still fails
> to populate results[], even though I'm still seeing a valid response
> with my network sniffer.
>
> ----------------------------------------------------
> [System.Web.Services.Protocols.SoapDocumentMethodAttribute
("http://temp
> uri.org/Login",
> ResponseElementName="LoginResponse",
> RequestNamespace="Some API",
> ResponseNamespace="Some API",
> Use=System.Web.Services.Description.SoapBindingUse.Literal,
> ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrap
p
> ed)]
> [return: System.Xml.Serialization.XmlElementAttribute("element1")]
> public string Login(string param1, string param2, string param3, out
> string element2) {
> object[] results = this.Invoke("Login", new object[] {
> param1,
> param2,
> param3});
> element2 = ((string)(results[1]));
> return ((string)(results[0]));
> }
> ----------------------------------------------------
>
>
> ----------------------------------------------------
> Is there anything wrong with my class attributes?
>
> [System.Diagnostics.DebuggerStepThroughAttribute()]
> [System.ComponentModel.DesignerCategoryAttribute("code")]
> [System.Web.Services.WebServiceBindingAttribute(Name="SomeApiSoap",
> Namespace="http://tempuri.org/")]
> public class SomeApi :
> System.Web.Services.Protocols.SoapHttpClientProtocol {
> ...
> }
> ----------------------------------------------------
>
>
> Thanks again,
>
> Jared
Here's my own answer based on the following post:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8
&safe=off&threadm=avmXa.5874%24Ye.5664%40fed1read02&rnum=4&prev=/groups%
3Fq%3Dnull%2520%2522SOAP%253A%253ALite%2522%26num%3D30%26hl%3Den%26lr%
3D%26ie%3DUTF-8%26oe%3DUTF-8%26safe%3Doff%26sa%3DN%26tab%3Dwg
(Note that the web service is Perl SOAP::Lite)
-----------------------------------------------------------------
[System.Web.Services.Protocols.SoapDocumentMethodAttribute
("http://tempuri.org/Login",
ResponseElementName="LoginResponse",
RequestNamespace="Some API",
ResponseNamespace="Some API",
Use=System.Web.Services.Description.SoapBindingUse.Encoded,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)
]
[return: System.Xml.Serialization.SoapElementAttribute("element1")]
public string Login(string param1, string param2, string param3, out
string element2) {
...
}
The fixes were:
1) Use SoapBindingUse.Encoded instead of Literal
2) Use Serialization.SoapElementAttribute("element1") instead of
XmlElementAttribute("element1")
-----------------------------------------------------------------
- Next message: Paolo Liverani: "Re: webservice concurrency"
- Previous message: T.U.F.F.: "Special treatment on Netscape browsers (disadvantage)"
- In reply to: Jared: "Re: Proxy class not reading data returned in SOAP response"
- Messages sorted by: [ date ] [ thread ]