Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / September 2003

Tip: Looking for answers? Try searching our database.

Using .NET web services proxy with Java based server

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sasson Havusha - 21 Sep 2003 17:19 GMT
I am developing a web services client in .NET. The web services and their corresponding wsdl are hosted in a Tomcat web server. When I use the wsdl for generating a .NET proxy, .NET generates a proxy and properly binds it to the wsdl. However, when I run that proxy, the returned objects are always null. The returned message appears to be structurely correct and contains data in the returned elements.
I used the same wsdl with IIS as a web server on the local host, and .NET returns the data correctly.

I would greatly appreciate any help. Thanks.

Sasson Havusha

Attached  are samples of the returned messages

--------------------------  Tomcat --------------------------------------------

ResponseCode: 200 (OK)
Content-Type:text/xml; charset="utf-8"
Content-Length:395
SOAPAction:""
Date:Sun, 21 Sep 2003 15:38:33 GMT
Server:Apache Coyote/1.0
<?xml version="1.0" encoding="utf-16"?>
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soap-env:Body>
   <initializeResponse xmlns="http://www.idx.com/hco/services">
     <initializeResult>
       <HCOAccessKey>OK</HCOAccessKey>
     </initializeResult>
   </initializeResponse>
 </soap-env:Body>
</soap-env:Envelope>

--------------------------------------------- .NET/IIS ---------------------------------------------------------

ResponseCode: 200 (OK)
Server:Microsoft-IIS/5.0
Date:Sun, 21 Sep 2003 15:27:28 GMT
X-Powered-By:ASP.NET
X-AspNet-Version:1.1.4322
Cache-Control:private, max-age=0
Content-Type:text/xml; charset=utf-8
Content-Length:383
<?xml version="1.0" encoding="utf-16"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <soap:Body>
   <initializeResponse xmlns="http://tempuri.org/">
     <initializeResult>
       <HCOAccessKey>OK</HCOAccessKey>
     </initializeResult>
   </initializeResponse>
 </soap:Body>
</soap:Envelope
Arthur Nesterovsky - 22 Sep 2003 10:05 GMT
Hi,

> The returned message appears to be structurely correct and
> contains data in the returned elements. I used the same wsdl
> with IIS as a web server on the local host, and .NET returns
> the data correctly.

Take a look at these two following fragments:

>     <initializeResponse xmlns="http://www.idx.com/hco/services">
>       <initializeResult>
>         <HCOAccessKey>OK</HCOAccessKey>
>       </initializeResult>
>     </initializeResponse>

and

>     <initializeResponse xmlns="http://tempuri.org/">
>       <initializeResult>
>         <HCOAccessKey>OK</HCOAccessKey>
>       </initializeResult>
>     </initializeResponse>

Did you see any difference? No?

Well, it seems that your client does not recognize the answer from Tomcat
due to it is in unknown namespace. The solution is to set attribute
[ResponseNamespace = "http://www.idx.com/hco/services"] over the
method, which has to retrieve this response.

Hope this help.
______________________________
With best wishes, Arthur Nesterovsky
Please visit my home page:
     http://www.nesterovsky-bros.com
Sasson Havusha - 22 Sep 2003 16:58 GMT
Arthur,

Thank you for the tip. It does not solve the problem. This was one of the
first things I looked at. When .NET generates the proxy, it generates the
ResponseNamespace attribute which is derived from the wsdl. See below

       [System.Web.Services.Protocols.SoapDocumentMethodAttribute("",
RequestNamespace="http://www.idx.com/hco/services/",
ResponseNamespace="http://www.idx.com/hco/services/",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
       [return:
System.Xml.Serialization.XmlElementAttribute("initializeResult",
Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
       public HCOSessionHeader
initialize([System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Sch
ema.XmlSchemaForm.Unqualified)] string user,
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSche
maForm.Unqualified)] string pass,
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSche
maForm.Unqualified)] string conn) {
           object[] results = this.Invoke("initialize", new object[] {
                       user,
                       pass,
                       conn});
           return ((HCOSessionHeader)(results[0]));
       }

> Hi,
>
[quoted text clipped - 67 lines]
> Please visit my home page:
>       http://www.nesterovsky-bros.com

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.