aspose file tools*
The moose likes Web Services and the fly likes Problem with the missing namespace Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Problem with the missing namespace" Watch "Problem with the missing namespace" New topic
Author

Problem with the missing namespace

N Tiwa
Greenhorn

Joined: Aug 23, 2010
Posts: 14

Hi,

I am trying to access a web service using the WSDL url. I am able to get all the related classes from that wsdl using wsdl2java emitter. I am able to create a client that can basically call the methods of the web service. Now, the problem is I cannot access the public methods of the web service. When I try to access a method called login, I get the error saying "cannot find the dispatch method for {null}x". I tried to figure out the problem with this error message and found that it generally occurs when there is a mismatch in the target namespace. I tried to log the SOAP request that were sent out from the web client that I have created using network sniffer like wireshark. Then I extracted the SOAP messages out of the request that were sent to the IP I was interested in. Also, I used a SOAP Ui to capture the SOAP request(which were generated from the wsdl).Then I tried to compare the 2 SOAP requests and found there is a missing namespace (which is the only major difference in the 2 messages).The following are the SOAP messages:
Generated from the SOAP Ui using the wsdl file (This one works):
RSS, Web Services and SOAP Syntax

<soapenv:Header/>
<soapenv:Body>
<met:login>
<auth>
<id>X</id>
<password>XY</password>
</auth>
</met:login>
</soapenv:Body>
</soapenv:Envelope>

Generated from the web client (captured using wireshark)(This one DOES NOT work)
RSS, Web Services and SOAP Syntax

<soapenv:Body>
<auth xmlns="">
<id>X</id>
<password>XY</password>
</auth>
</soapenv:Body>
</soapenv:Envelope>

I tried testing the the SOAP request by putting xmlns="" in the WORKING soap REQUEST and it went through fine. SO, the only problem is due to <met:login> tag which is absent in the second SOAP request.

The problem is I am not able to understand what should I do in order to generated a similar SOAP request with my web client. I am using axis2 and wsdl2java emitter for generation on the classes as well as the SOAP messages. I mean they are automatically generated and I am not sure how should I change the SOAP request so that I get a response instead of the error message cannot find dispatch method.
Can anyone help me out with this matter. I need some guidance on how to resolve this issue. Can anyone tell me what I am doing wrong that is actually leading to this problem? Any help is appreciated!!!
 
Don't get me started about those stupid light bulbs.
 
subject: Problem with the missing namespace