Link to home
Start Free TrialLog in
Avatar of leobaz2
leobaz2

asked on

XML namespace prefix appearing

We have recently migrated our JAX-RPC web services from Websphere 5.1 to 7.0.  The web services have not changed during the migration and the WSDL files for both versions are identical.  However, there is one difference in the web service response that is causing problems for the client.  Apparently there is a namespace prefix (p909) added for the elements that originally did not have any prefix.  This prefix is not in any of the WSDL files nor is it part of the request.  It just appears out of nowhere.

Does anyone know why this prefix is being added and how to prevent it?  Could it be a Websphere setting?

Thanks
Avatar of leobaz2
leobaz2

ASKER

Here are the responses that we return.  The top one is from websphere 7.0 and the bottom from websphere 5.1.  As you can see, they are the same except for the p909 prefix.
Websphere 7.0
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
  <p909:authenticateResponse xmlns:p909="http://webservice.abc.com">
  <p909:authenticateReturn>22DCAEB2C4777901B34EB33262A9778FBA6CDD</p909:authenticateReturn> 
  </p909:authenticateResponse>
  </soapenv:Body>
</soapenv:Envelope>

Websphere 5.1
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
  <authenticateResponse xmlns="http://webservice.abc.com">
  <authenticateReturn>22DCAEB2C4777901B34EB33262A9778FBA6CDD</authenticateReturn> 
  </authenticateResponse>
  </soapenv:Body>
</soapenv:Envelope>

Open in new window

I think the reasons why it has been added in 7.0 are given in this rather long but extensive article :-

http://www.ibm.com/developerworks/webservices/library/ws-tip-namespace.html

and it seems that by setting elementFormDefault="unqualified" you might get the original back again.


Strictly speaking BOTH forms of the XML are perfectly legal and the client ought to be conform.
ASKER CERTIFIED SOLUTION
Avatar of leobaz2
leobaz2

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial