aspose file tools*
The moose likes Web Services and the fly likes namespace mismatch  in webservice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "namespace mismatch  in webservice" Watch "namespace mismatch  in webservice" New topic

namespace mismatch in webservice

shekhar puttur

Joined: Mar 30, 2010
Posts: 8
Hi All,
I am developing a Java webservice which uses with apache tomcat and axis2.1.4.1.
Cliinet side i use gsoap2.7.15 .
At the client i am not getting result due to namespace mismatch.
Logs are:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:SOAP-ENC="" xmlns:xsi="" xmlns:xsd="" xmlns:ns1="http://pcrf.condor"><SOAP-ENV:Body><ns1:add><ns1:input>101</ns1:input></ns1:add></SOAP-ENV:Body></SOAP-ENV:Envelope>

<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv=""><soapenv:Body><ns:addResponse xmlns:ns="http://pcrf.condor"><ns:return>131</ns:return></ns:addResponse></soapenv:Body></soapenv:Envelope>


Push OK ('soapenv' matches 'SOAP-ENV' in namespace table)
Tags and (default) namespaces match: 'soapenv:Envelope' 'SOAP-ENV:Envelope'
Begin element found (level=1) 'soapenv:Envelope'='SOAP-ENV:Envelope'
stdsoap2.cpp(13682): malloc(42) = 0x8f21790
Tags and (default) namespaces match: 'soapenv:Body' 'SOAP-ENV:Body'
Begin element found (level=2) 'soapenv:Body'='SOAP-ENV:Body'
stdsoap2.cpp(8228): malloc(28) = 0x8f217c0
stdsoap2.cpp(8282): malloc(256) = 0x8f217f8
stdsoap2.cpp(2652): malloc(22) = 0x8f21918
Push namespace binding (level=2) 'ns' 'http://pcrf.condor'
Push OK ('ns' matches 'ns1' in namespace table)
Tags and (default) namespaces match: 'ns:addResponse' 'ns1:addResponse'
Begin element found (level=3) 'ns:addResponse'='ns1:addResponse'
Enter id='' type=9 loc=0xbfe94460 size=12 level=0
Unexpected element 'ns:return' in input (level=3, 1)
Tags 'ns:return' and 'SOAP-ENV:' match but namespaces differ
IGNORING element 'ns:return'
End element found (level=4) 'ns:return'=''
End element found (level=3) 'ns:addResponse'='ns1:addResponse'
End element found (level=2) 'soapenv:Body'='SOAP-ENV:Body'
End element found (level=1) 'soapenv:Envelope'='SOAP-ENV:Envelope'
End of receive message ok

In the response namespace is ns, that is actually causing the mismatch at the client,

How to solve this namespace issue?
Could please tell me the solution.

Ankit Garg

Joined: Aug 03, 2008
Posts: 9280

Shekhar this is the Meaningless Drivel forum, a web service problem has nothing to do with it. Please Carefully Choose One Forum when you start a topic. Also UseCodeTags when you post a source code.

I'll move this topic to the appropriate forum...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
subject: namespace mismatch in webservice
Similar Threads
xpath does not match when namespace prefix changes
Extrange codes in the response from axis
Namespace is removed from Responce on WebSphere in SOAP based Service
Issues while creating a SOAP message
Edit Soap tags response using Axis2 in eclipse