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
leobaz2Asked:
Who is Participating?
 
leobaz2Connect With a Mentor Author Commented:
The solution was to set the JVM property com.ibm.ws.webservices.serializeOperationElementUsingDefaultNamesapce=true.  This suppresses the prefix from being generated.
0
 
leobaz2Author Commented:
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

0
 
BigRatCommented:
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.
0
All Courses

From novice to tech pro — start learning today.