Home > Archive > Microsoft Webservices > April 2006 > null object returnd to .net client while calling axis web service
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
null object returnd to .net client while calling axis web service
|
|
| John Smith 2006-04-14, 4:10 am |
|
I'm expiriencing the same problem as someone posted one year ago:
http://groups.google.com/group/micr...480c84619bf4244
Unfortunatelly, there wasn't an answer posted, too. I've searched the web,
but couldn't find even one similar topic to this one. :(
| |
|
|
"John Smith" <john.smith@microsoft.com> a écrit dans le message de news:
I8I%f.1755$oj5.674889@news.siol.net...
>
> I'm expiriencing the same problem as someone posted one year ago:
>
> http://groups.google.com/group/micr...480c84619bf4244
>
> Unfortunatelly, there wasn't an answer posted, too. I've searched the web,
> but couldn't find even one similar topic to this one. :(
>
>
I had a similar problem not so long ago.
The .Net generated code was not able to deserialize the response because the
namespace was absent or not equal to the namespace declared in the WSDL.
I sometimes had a null document and sometimes an exception "invalid XML"
depending how the .Net code was generated from WSDL.
Hope this help.
Rémy
| |
| John Smith 2006-04-14, 4:10 am |
|
> The .Net generated code was not able to deserialize the response because
> the
> namespace was absent or not equal to the namespace declared in the WSDL.
>
> I sometimes had a null document and sometimes an exception "invalid XML"
> depending how the .Net code was generated from WSDL.
Is there any solution? :(
| |
| John Smith 2006-04-14, 4:10 am |
|
> The .Net generated code was not able to deserialize the response because
> the
> namespace was absent or not equal to the namespace declared in the WSDL.
I don't understand what should .Net deserialize and why would it fail?
WebService is returning XmlDocument and all .Net have to do is to
deserialize response into XmlDocument. I don't understand why that would
fail. Btw, I'm not using WSDL file at all. Also, I'm not using Visual Studio
2005 auto generated classes from WSDL file. This is what I do:
[System.Web.Services.WebServiceBindingAttribute(Name =
"ValidateSoapBinding")]
public class MyWebService : SoapHttpClientProtocol
{
[System.Web.Services.Protocols.SoapDocumentMethodAttribute(Use =
System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle =
System.Web.Services.Protocols.SoapParameterStyle.Bare)]
public XmlDocument validate(string url, XmlDocument xmlDocument)
{
this.Url = url;
object[] results = null;
try
{
results = this.Invoke("validate", new object[] { null,
xmlDocument });
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
return null;
}
return ((XmlDocument)(results[0]));
}
}
and call it like this:
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.PreserveWhitespace = true;
xmlDocument.Load(cmbFile.Text);
MyWebService web = new MyWebService();
xmlDocument = web.validate(cmbURL.Text, xmlDocument);
if (xmlDocument != null)
{
...
}
| |
| John Smith 2006-04-14, 4:10 am |
|
Are there some "low-level" SOAP functions in .Net? I would like to serialize
and deserialize SOAP request/response by myself. It is obvious that .Net is
not capable of doing it.
|
|
|
|
|