This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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
 
Similar Threads
wsdl2java and namespace declarations
namespace problem in request soap message
web service explorer testing Web service gets right return value, java client gets wrong value
Axis2 BASIC AUTHENTICATION
Help needed to call a web service after TAM authentication - (401)Unauthorized