adding "xsi:type" attribute in SOAP request for Doc literal (JBoss) WSDL

Hello Users,

I am having an issue while composing a SOAP message while integrating with web services on JBoss server.

This is the SOAP request that JBoss is expecting:

[HTML]
<soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsd=“XML Schema” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>
<SOAP-ENV:Header xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/”/>
soapenv:Body

1234
12317923712371832

en


username
password123


</soapenv:Body>
</soapenv:Envelope>
[/HTML]

But when i compose the above message and convert it to xml node (xmlstringToxmlNode) and try to call the pub.soap.utils:addBodyEntry service to add it to the Soap Data object i get an error saying it is malformed xml.

[ISS.0088.9131] Invalid node: must be well-formed XML
 at pub.soap.utils.completeLoad(utils.java:1478)
 at pub.soap.utils.getElement(utils.java:1380)
 at pub.soap.utils.addBodyEntry(utils.java:70)

When i removed the xsi:type=“ns1:PasswordCredentials” from the message i am able to add the message to the body with no issues. Did any one see such an issue before? If so how to generate these “xsi:type” attribute for doc literal WS? currently i am creating a variable @xsi:type string inside the document and hard coding the value “ns1:PasswordCredentials” in to it.

This is my flow.

createSoapData
documentToXMLString
xmlStringToXMLNode (isXML=true)
addBodyEntry (this step error’s, if i include xsi:type=“ns1:PasswordCredentials” in the message).

Any help or direction is appreciated.

I did check the extended setting watt.server.SOAP.encodeXSIType=true and it mentions that is valid only for RPC/encoded ws but not for Doc literal.

Cheers,
Akshith

Akshith,

I’m not sure if the issue is because of the XSI tag but before going forward I couldn’t find the openning tags for the above two tags. I guess there is a ‘cobrand’ attached to the login and Credentials closing tags.

Remove the cobrand and try again.

HTH.

Suren,

My bad, i edited the SOAP request during the post and missed the tag names. Here is the intended SOAP request that i should compile and having issues with.

[HTML]<soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsd=“XML Schema” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>
<SOAP-ENV:Header xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/”/>
soapenv:Body

123456
12343948734573

en


username
password


cob:loginCobrand/
</soapenv:Body>
</soapenv:Envelope>[/HTML]

Some more additional information from the error logs.

Caused by: com.wm.lang.xml.WMDocumentException: [ISC.0042.9329] No namespace declaration defined for attribute xsi:type in element :cobrandCredentials
at com.wm.lang.xml.DocumentTreeBuilder.processNextToken(DocumentTreeBuilder.j

Attached is a screen shot of my input doc structure.

Thanks,
Akshith

I had to do a name space declaration for “xsi” at the documentToXMLString service and that resolved the issue.

Cheers,
Akshith