Good day!
I'm sending this out wondering whether anyone has seen similar behavior
and might have an idea how I might resolve the issue.
I have a web application built using Spring and Castor. Spring
front-ends SOAP requests and then Castor does all the
marshalling/unmarshalling. I have a mapping file that defines the
XML-to-bean relationships.
Here is a piece of the mapping file that defines an mapping for Agent
Phone data (call center rep registering with their soft phone).
<!--
Mapping for AgentPhoneRequest - Abstract Class holding common Phone
request data
Since this class is abstract, there is no <map-to> element.
-->
<class name="com.ba.servicegovernor.webservice.AgentPhoneRequest">
<field name="agentPhoneExtension"
type="string"
required="false">
<bind-xml name="phone:AgentPhoneExtension" node="element"/>
</field>
<field name="agentUserId"
type="string"
required="false">
<bind-xml name="phone:AgentUserID" node="element"/>
</field>
</class>
<!--
Mapping for AgentRegister request - Agent Phone Register request data
-->
<class
name="com.ba.servicegovernor.webservice.AgentPhoneRegisterRequest"
extends="com.ba.servicegovernor.webservice.AgentPhoneRequest"
auto-complete="false">
<map-to xml="AgentRegister"
ns-uri=
"urn:RE:SOAP:CGBACTI:Event"
ns-prefix="tns"/>
<field name="agentWorkstationIPAddress"
type="string"
required="false">
<bind-xml name="phone:AgentWorkstationIPAddress" node="element"/>
</field>
</class>
All works great on my local machine (Tomcat/Windows/JDK 1.4). Here is
the XML sent in the SOAP request:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<tns:AgentRegister xmlns:tns="urn:RE:SOAP:CGBACTI:Event">
<tns:AgentPhoneExtension>phoneExt</tns:AgentPhoneExtension>
<tns:AgentUserID>agentID</tns:AgentUserID>
<tns:AgentWorkstationIPAddress>ipAddress</tns:AgentWorkstationIPAddress>
</tns:AgentRegister>
</soapenv:Body>
</soapenv:Envelope>
However, when I deploy on the server (WebSphere/AIX/JDK 1.4) the
resulting XML is:
<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:Header/>
<soapenv:Body>
<tns:AgentRegister>
<tns:AgentPhoneExtension>phoneExt</tns:AgentPhoneExtension>
<tns:AgentUserID>agentID</tns:AgentUserID>
<tns:AgentWorkstationIPAddress>ipAddress</tns:AgentWorkstationIPAddress>
</tns:AgentRegister>
</soapenv:Body>
</soapenv:Envelope>
Notice that the namespace definition is not provided on the
AgentRegister element which causes a parser exception. Also, the
message now has an additional namespace definition for "soapenc" on the
envelope and adds the <Header> element, but those don't break anything.
Has anyone seen different environments alter the generated XML? Any
idea how to workaround this?
Appreciate any guidance you can offer.
Regards,
-Dave
This e-mail and any files transmitted with it are for the sole use of
Blue Slate Solutions and the intended recipient(s) and may contain
confidential and privileged information. If you are not the intended
recipient, please contact the sender by reply e-mail and destroy all
copies of the original message. Any unauthorized review, use,
disclosure, dissemination, forwarding, printing or copying of this email
or any action taken in reliance on this e-mail is strictly prohibited
and may be unlawful.