1 Reply Latest reply on Oct 12, 2006 8:35 AM by caldron68

    Message style endpoint IN/OUT parameters

    caldron68 Newbie


      I'm using JBossWS 1.0.3 to develop message style web services and have a question concerning the IN/OUT parameters of the message endpoint.

      I'm trying to follow the example from the user guide (Chapter 3) and have developed several endpoints, each of which takes a SOAPElement as an
      input argument and also returns a SOAPElement to the caller. In the WSDL, which I mostly wrote by hand, the message names for the input
      and output parameters are all mapped to type "xsd:anyType". I would have thought that this would allow me to call the methods with any raw
      XML message (wrapped in a SOAPElement of course), but this does not appear to be the case. The problem is that bacause the wsdl mapping
      actually contains a message "name", JBossWS seems to expect that the message I return to be defined as an element with the same name.
      In other words, I can't return two different messages from the same
      endpoint, which is something that I could do using the older WS4EE Axis based material.

      Here are the relevant parts of the wsdl and the jaxrpc-mapping files:

       <xsd:schema targetNamespace='http://scte.org/dvs629/msg' xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns='http://scte.org/dvs629/msg' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
       <xsd:element name="AvailRequest" type="xsd:anyType"/>
       <xsd:element name="ServiceError" type="xsd:anyType"/>
      <message name='ADSMessageServer_processAvailRequest'>
       <part element='tns:AvailRequest' name='request' />
       <message name='ADSMessageServer_processAvailRequestResponse'>
       <part element='tns:AvailResponse' name='response' />
      <portType name='ADSMessageServer'>
       <operation name='processAvailRequest'>
       <input message='tns:ADSMessageServer_processAvailRequest'/>
       <output message='tns:ADSMessageServer_processAvailRequestResponse'/>
       <binding name='ADSMessageServerBinding' type='tns:ADSMessageServer'>
       <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
       <operation name='processAvailRequest'>
       <soap:operation soapAction=''/>
       <soap:body use='literal' namespace="http://scte.org/dvs629/msg" />
       <soap:body use='literal' namespace="http://scte.org/dvs629/msg" />

      And from the jaxrpc-mapping file:

       <wsdl-message xmlns:wsdlMsgNS='http://scte.org/dvs629/msg'>wsdlMsgNS:ADSMessageServer_processAvailRequest</wsdl-message>
       <wsdl-message xmlns:wsdlMsgNS='http://scte.org/dvs629/msg'>wsdlMsgNS:ADSMessageServer_processAvailRequestResponse</wsdl-message>

      What I want to be able to do is to return a ServiceError element in place of an AvailRequest element under certain conditions, which may not be
      error conditions. What happens when I try this is that JBossWS throws an exception and complains that the "Content root name does not match element name",
      i.e. the stack expected to see an element of type AvailRequest but was presented with a ServiceError instead.

      So, how to proceed? I really want to be able to use a single web-service endpoint and have that endpoint accept and return any raw XML document
      that I choose to send in. Any help would be greatly appreciated.


        • 1. Re: Message style endpoint IN/OUT parameters
          caldron68 Newbie

          Nothing on this yet? This is something that works fine in the AXIS stack
          and worked fine in the WS4EE stack, but seems to be broken in the
          JBossWS stack. If my web-service method is defined to take a SOAPElement
          as input and to return a SOAPElement, I don't understand why the stack
          should care about the name of the root element being returned.