2 Replies Latest reply on Apr 6, 2010 5:27 PM by lall lall

    WRAPPED ParameterStyle bpel process receive WS returns null

    lall lall Newbie

      Hi,

       

      Calling a BPEL process with a receive WS (parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
      with a junit test client, the return value is null. When I use SOAPBinding.ParameterStyle.BARE,
      there are no problems. The client uses the ws client proxy classes generated by wsprovide and wsconsume.

       


      The intial WebService:

       

      @WebService(name = "ReceiveWS", targetNamespace = "http://bpel.com/ws/receive", serviceName = "ReceiveService")
      @SOAPBinding(
              style = SOAPBinding.Style.DOCUMENT,
              parameterStyle = SOAPBinding.ParameterStyle.WRAPPED
      )
      public class ReceiveWSImpl {
        @WebMethod
        @WebResult(name = "MessageResponse", targetNamespace = "http://bpel.com/ws/receive", partName = "MessageResponsePart")
        public String getMessage(
            @WebParam(name = "MessageRequest", targetNamespace = "http://bpel.com/ws/receive", partName = "MessageRequestPart")
            String messageRequestPart) {
            return messageRequestPart+": "+System.currentTimeMillis();
        }
      }

       

       

       

      process:

       

      <process name="InitialBpelProcess"
               targetNamespace="http://bpel.com"
               xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
               xmlns:tns="http://bpel.com"
               xmlns:xsd="http://www.w3.org/2001/XMLSchema"
               xmlns:ns1="http://bpel.com/ws/receive"
               queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
               expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">
              
        <import location="ReceiveService.wsdl"
                namespace="http://bpel.com/ws/receive"
                importType="http://schemas.xmlsoap.org/wsdl/"/>
               
        <partnerLinks>
          <partnerLink name="ReceiveServicePartnerLink"
                       partnerLinkType="ns1:ReceiveServicePartnerLinkType"
                       myRole="ReceiveServiceRole"/>
        </partnerLinks>

       

        <variables>
          <variable name="GetMessageVar" messageType="ns1:ReceiveWS_getMessage"/>
          <variable name="GetMessageResponseVar" messageType="ns1:ReceiveWS_getMessageResponse"/>
        </variables>

       

        <sequence>   
          <receive partnerLink="ReceiveServicePartnerLink"
                   portType="ns1:ReceiveWS"
                   operation="getMessage"
                   variable="GetMessageVar"
                   createInstance="yes"/>
                  
          <assign>
            <copy>
              <from>concat($GetMessageVar.MessageRequest, 'sdfsdf')</from>
              <to variable="GetMessageResponseVar" part="getMessageResponse"/>
            </copy>
          </assign>
                  
          <reply partnerLink="ReceiveServicePartnerLink"
                 portType="ns1:ReceiveWS"
                 operation="getMessage"
                 variable="GetMessageResponseVar"/>
                
        </sequence>
      </process>

       


      WSDL wrapped:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <definitions name='ReceiveService' targetNamespace='http://bpel.com/ws/receive' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://bpel.com/ws/receive' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
      <types>
        <xs:schema targetNamespace='http://bpel.com/ws/receive' version='1.0' xmlns:tns='http://bpel.com/ws/receive' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
         <xs:element name='getMessage' type='tns:getMessage'/>
         <xs:element name='getMessageResponse' type='tns:getMessageResponse'/>
         <xs:complexType name='getMessage'>
          <xs:sequence>
           <xs:element form='qualified' minOccurs='0' name='MessageRequest' type='xs:string'/>
          </xs:sequence>
         </xs:complexType>
         <xs:complexType name='getMessageResponse'>
          <xs:sequence>
           <xs:element form='qualified' minOccurs='0' name='MessageResponse' type='xs:string'/>
          </xs:sequence>
         </xs:complexType>
        </xs:schema>
      </types>
      <message name='ReceiveWS_getMessage'>
        <part element='tns:getMessage' name='getMessage'/>
      </message>
      <message name='ReceiveWS_getMessageResponse'>
        <part element='tns:getMessageResponse' name='getMessageResponse'/>
      </message>
      <portType name='ReceiveWS'>
        <operation name='getMessage' parameterOrder='getMessage'>
         <input message='tns:ReceiveWS_getMessage'/>
         <output message='tns:ReceiveWS_getMessageResponse'/>
        </operation>
      </portType>
      <binding name='ReceiveWSBinding' type='tns:ReceiveWS'>
        <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
        <operation name='getMessage'>
         <soap:operation soapAction=''/>
         <input>
          <soap:body use='literal'/>
         </input>
         <output>
          <soap:body use='literal'/>
         </output>
        </operation>
      </binding>

       

      <service name='ReceiveService'>
        <port binding='tns:ReceiveWSBinding' name='ReceiveWSPort'>
         <soap:address location='http://127.0.0.1:8080/bpel-ws-receive'/>
        </port>
      </service>

      <plnk:partnerLinkType name="ReceiveServicePartnerLinkType">
        <plnk:role name="ReceiveServiceRole" portType="tns:ReceiveWS"/>
      </plnk:partnerLinkType>
      </definitions>

       


      WSDL bare:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <definitions name='ReceiveService' targetNamespace='http://bpel.com/ws/receive' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://bpel.com/ws/receive' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
      <types>
        <xs:schema targetNamespace='http://bpel.com/ws/receive' version='1.0' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
         <xs:element name='MessageRequest' nillable='true' type='xs:string'/>
         <xs:element name='MessageResponse' nillable='true' type='xs:string'/>
        </xs:schema>
      </types>
      <message name='ReceiveWS_getMessage'>
        <part element='tns:MessageRequest' name='MessageRequestPart'/>
      </message>
      <message name='ReceiveWS_getMessageResponse'>
        <part element='tns:MessageResponse' name='MessageResponsePart'/>
      </message>
      <portType name='ReceiveWS'>
        <operation name='getMessage' parameterOrder='MessageRequestPart'>
         <input message='tns:ReceiveWS_getMessage'/>
         <output message='tns:ReceiveWS_getMessageResponse'/>
        </operation>
      </portType>
      <binding name='ReceiveWSBinding' type='tns:ReceiveWS'>
        <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
        <operation name='getMessage'>
         <soap:operation soapAction=''/>
         <input>
          <soap:body use='literal'/>
         </input>
         <output>
          <soap:body use='literal'/>
         </output>
        </operation>
      </binding>
      <service name='ReceiveService'>
        <port binding='tns:ReceiveWSBinding' name='ReceiveWSPort'>
         <soap:address location='http://127.0.0.1:8080/bpel-ws-receive'/>
        </port>
      </service>

      <plnk:partnerLinkType name="ReceiveServicePartnerLinkType">
        <plnk:role name="ReceiveServiceRole" portType="tns:ReceiveWS"/>
      </plnk:partnerLinkType>
      </definitions>

       


      client:

       

      public class TestReceiveWS {
          private ReceiveWS sei;
         
          @Before
          public void setUp() throws Exception {
              ReceiveService service = new ReceiveService();
              sei = service.getReceiveWSPort();
          }

       

          @After
          public void tearDown() throws Exception {
          }
         
          @Test
          public void testReceiveWS() {
              String result = sei.getMessage("aaa");
              log.debug("result="+result);
             
              //DEBUG [com.bpel.ws.receive.TestReceiveWS] result=null with WRAPPED
              //DEBUG [com.bpel.ws.receive.TestReceiveWS] result=aaasdfsdf with BARE
          }
      }

       

      All the examples use RPC style WebServices. Is SOAPBinding.ParameterStyle.WRAPPED
      not supported yet and may this be the reason why null is returned?

       

       

      Kind regards

       

      Simon