Hi,
There is lot of code in this mail. Hope I am asking the right question.
I am using the doc/lit style to send a xs:string type. Now if I post an
entire XML then it gets wrapped in CDATA. I am using Axis 2 XMLBeans
bindings. The WSDL is pasted at the end.
The SOAP message is
<?xml version=...............?>
<soapenv:Envelope xmlns:soapenv="http:
//schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body><something:test
xmlns:
something="http://test.com">
<something:arg0><![CDATA[<Request
xsi:
noNamespaceSchemaLocation="Test1.0.4.xsd"
xmlns:xsi="http://www.w3.
org/2001/XMLSchemainstance">
<Header>
..........
.........
</soapenv:Envelope>
when I use this code.
stub =
new TestServiceStub( SECURE_WEB_SERVICE );
document =
TestDocument.Factory.newInstance();
File file = new File("Request.xml" );
Request request =
Request.
Factory.
parse( getXml( file ) ); //Set XML as
string
test = document.addNewTest();
test.setArg0( request.toString() );
document.setTest( test );
In the code shown above if I replaced
setArg0( request.toString() );
with
set( getXmlObject() ); //XMLBeans API
I get my XML as a child like this.
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<someprefix:test xmlns:rul="http://test.com">
<Request xsi:noNamespaceSchemaLocation="Test.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance">
....................
</soapenv:Envelope>
but
the error is "Unexpected subelement".
1. Which of these two styles is correct according to the WSDL.
2. How is "someprefix" getting generated. It does not match anything in my
WSDL.
(E.G) <someprefix:test xmlns:rul="http://test.com">
Thanks,
Mohan
<?xml version='1.0' encoding='UTF-8'?>
<s0:definitions name="TestServiceDefinitions"
targetNamespace="http://test.com" xmlns=""
xmlns:s0="http://schemas.xmlsoap.org/wsdl/"
xmlns:s1="http://test.com"
xmlns:s2="http://schemas.xmlsoap.org/wsdl/soap/" >
<s0:types>
<xs:schema attributeFormDefault="unqualified"
elementFormDefault="qualified" targetNamespace="http://test.com"
xmlns:s0="http://schemas.xmlsoap.org/wsdl/" xmlns:s1="http://test.com"
xmlns:s2="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="test">
<xs:complexType>
<xs:sequence>
<xs:element name="arg0" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="testResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="return" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</s0:types>
<s0:message name="test">
<s0:part element="s1:test" name="parameters"/>
</s0:message>
<s0:message name="testResponse">
<s0:part element="s1:testResponse" name="parameters"/>
</s0:message>
<s0:portType name="TestPortType">
<s0:operation name="test" parameterOrder="parameters">
<s0:input message="s1:test"/>
<s0:output message="s1:testResponse"/>
</s0:operation>
</s0:portType>
<s0:binding name="TestServiceSoapBinding" type="s1:TestPortType">
<s2:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<s0:operation name="test">
<s2:operation soapAction="http://test.com/test" style="document"/>
<s0:input>
<s2:body parts="parameters" use="literal"/>
</s0:input>
<s0:output>
<s2:body parts="parameters" use="literal"/>
</s0:output>
</s0:operation>
</s0:binding>
<s0:service name="TestService">
<s0:port binding="s1:TestServiceSoapBinding" name="TestPort">
<s2:address
location="http://localhost:8081/axis2/services/TestService"/>
</s0:port>
</s0:service>
</s0:definitions>
--
View this message in context:
http://www.nabble.com/Document-literal-style---Send-XML-as-string-tp17620196p17620196.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]