[
https://issues.apache.org/jira/browse/CXF-788?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Daniel Kulp resolved CXF-788.
-----------------------------
Resolution: Invalid
Fix Version/s: Invalid
Assignee: (was: Adi Sakala)
If you are using the ObjectFactory to create a
JAXBElement<PingRequestBodyType> object for use in the PingRequest, you need to
call:
factory.createPingRequestEchoString(requestBody);
instead of:
factory.createPingRequestBodyType(requestBody);
to get the correct QName into the JAXBElement. The second call above creates
the JAXBElement set for use as a top level element.
> Unexpected part name in request message
> ---------------------------------------
>
> Key: CXF-788
> URL: https://issues.apache.org/jira/browse/CXF-788
> Project: CXF
> Issue Type: Bug
> Components: JAX-WS Runtime, JAXB Databinding, Tooling
> Reporter: Eoghan Glynn
> Fix For: Invalid
>
>
> This issue was exposed in the Microsoft WCF interop test cases for WS-RM
> (http://131.107.72.15/ilab/RM/WCFInteropPlugFest_RM.doc), with a CXF client
> running against a WCF endpoint.
> Starting with the WSDL at:
> http://131.107.72.15/ReliableMessaging_Service_WSAddressingAugust2004_Indigo/RequestReply.svc?wsdl
> the following code is used to invoke on the CustomBinding_IEchoString1 port:
> ObjectFactory factory = new ObjectFactory();
> QName tName = new QName("http://tempuri.org/", "Text");
> JAXBElement<String> tValue = new JAXBElement<String>(tName, String.class,
> "Hello");
> QName sName = new QName("http://tempuri.org/", "Sequence");
> // value should be that of the sequence but don't worry about that now
> JAXBElement<String> sValue = new JAXBElement<String>(sName, String.class,
> "123456789");
> PingRequestBodyType requestBody = factory.createPingRequestBodyType();
> requestBody.setText(tValue);
> requestBody.setSequence(sValue);
> JAXBElement<PingRequestBodyType> requestBodyElement =
> factory.createPingRequestBodyType(requestBody);
> PingRequest request = factory.createPingRequest();
> request.setEchoString(requestBodyElement );
> The WS-RM out-of-band sequence creation suceeds, but the application-level
> request is rejected by WCF. The problem is a mismatch between the actual
> message payloaded encoded on the wire by CXF:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> <soap:Header>
> <!-- WS-A & RM headers -->
> </soap:Header>
> <soap:Body>
> <PingRequest xmlns="http://tempuri.org/">
> <PingRequest.BodyType><Text>Hello</Text><Sequence>123456789</Sequence></PingRequest.BodyType>
> </PingRequest>
> </soap:Body>
> </soap:Envelope>
>
> and the format expected by WCF:
> <s:Body>
> <echoString xmlns="http://tempuri.org/"
> xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
> <Text>Hello</Text>
> <Sequence>urn:uuid:3c0ba104-815c-4d83-b2bb-47670a5f8083</Sequence>
> </echoString>
> </s:Body>
> Lokking at the relevant schema type:
> <xs:element name="PingRequest">
> <xs:complexType>
> <xs:sequence>
> <xs:element minOccurs="0" name="echoString" nillable="true"
> type="tns:PingRequest.BodyType" />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> the issue seems to be that CXF is encoding the message part named for the
> type ("tns:PingRequest.BodyType" in the <xs:element> definition above)
> whereas WCF is expecting the element name ("echoString" above in the schema
> exerpt).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.