3 Replies Latest reply on Jan 23, 2006 6:00 AM by Matt Boujonnier

    "Strange" WSDD generation, Jboss 4.02

    Matt Boujonnier Newbie

      - JBOSS 4.0.2

      I'm trying to write a WS server stub for a 3rd party web service provider :
      http://ws.strikeiron.com/globalsmspro2_5?WSDL

      So, I have generated interfaces using wscompile (1.6 and 2.0) -import
      (first I saw that complex IN types were unwrapped in the generated interface, which is not the case using BEA tools)

      Then I have deployed the web service stub on JBOSS which generates the WSDD

      Results :

      1. WSDL summary:

       <types>
       <s:schema xmlns:s="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.strikeiron.com">
       <s:element name="SendMessage">
       <s:complexType>
       <s:sequence>
       <s:element maxOccurs="1" minOccurs="0" name="ToNumber" type="s:string"/>
       <s:element maxOccurs="1" minOccurs="0" name="FromNumber" type="s:string"/>
       <s:element maxOccurs="1" minOccurs="0" name="FromName" type="s:string"/>
       <s:element maxOccurs="1" minOccurs="0" name="MessageText" type="s:string"/>
       </s:sequence>
       </s:complexType>
      
      ...
      
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
       <operation name="SendMessage">
      <soap:operation soapAction="http://www.strikeiron.com/SendMessage" style="document"/>
       <input>
      <soap:body use="literal"/>
      <soap:header message="s0:LicenseInfoMessage" part="LicenseInfo" use="literal"/>
      </input>
       <output>
      <soap:body use="literal"/>
      <soap:header message="s0:SendMessageResponseInfo" part="ResponseInfo" use="literal"/>
      <soap:header message="s0:SubscriptionInfoMessage" part="SubscriptionInfo" use="literal"/>
      </output>
      </operation>


      2. Java generated interfaces by wscompile

      public ws.stub.strikeiron.SMSTextMessageTargetStatus sendMessage(
      java.lang.String toNumber,
      java.lang.String fromNumber,
      java.lang.String fromName,
      java.lang.String messageText,
      LicenseInfo licenseInfo,
      ResponseInfoHolder responseInfo,
      SubscriptionInfoHolder subscriptionInfo
      ) throws java.rmi.RemoteException;


      3. WSDD generated file by JBOSS

      <operation name='sendMessage' qname='ns1:SendMessage' xmlns:ns1='http://www.strikeiron.com' >
       <parameter name='parameters' qname='ns1:SendMessageResponse' mode='INOUT' type='ns1:SendMessageResponse' xmlns:ns1='http://www.strikeiron.com' />
       </operation>
      
      ...
      
       <typeMapping
       qname='ns1:SendMessage' xmlns:ns1='http://www.strikeiron.com'
       type='java:ws.stub.strikeiron.SendMessage'
       serializer='org.jboss.webservice.encoding.ser.MetaDataBeanSerializerFactory'
       deserializer='org.jboss.webservice.encoding.ser.MetaDataBeanDeserializerFactory'
       encodingStyle=''>
       <typeDesc>
       <elementDesc fieldName='toNumber' xmlName='ToNumber'/>
       <elementDesc fieldName='fromNumber' xmlName='FromNumber'/>
       <elementDesc fieldName='fromName' xmlName='FromName'/>
       <elementDesc fieldName='messageText' xmlName='MessageText'/>
       <elementOrder>
       <element name='toNumber'/>
       <element name='fromNumber'/>
       <element name='fromName'/>
       <element name='messageText'/>
       </elementOrder>
       </typeDesc>
       </typeMapping>
      
       <typeMapping
       qname='ns1:SendMessageResponse' xmlns:ns1='http://www.strikeiron.com'
       type='java:ws.stub.strikeiron.SendMessageResponse'
       serializer='org.jboss.webservice.encoding.ser.MetaDataBeanSerializerFactory'
       deserializer='org.jboss.webservice.encoding.ser.MetaDataBeanDeserializerFactory'
       encodingStyle=''>
       <typeDesc>
       <elementDesc fieldName='sendMessageResult' xmlName='SendMessageResult'/>
       <elementOrder>
       <element name='sendMessageResult'/>
       </elementOrder>
       </typeDesc>
       </typeMapping>
      
      


      So as you can see, the WSDD generated, as I understand, does not map the operation with the good parameters (only SendMessageResponse is set)

      So of course, when accessing the webservice, I've got an error : The OperationDesc for SendMessage was not synchronized to a method of ...


      Is it a known WS/JBOSS bug fixed in 4.0.4 (as some other WS bugs) ???
      What's wrong with this WDSL and JBOSS ? (As all the WSDL I have generated with wscompile work well in JBOSS)

      Thanks !

      shazz


        • 1. Re:
          Thomas Diesler Master

          This looks like a bug related to document/literal endpoints that bind header elements to the endpoint target method.

          http://jira.jboss.org/jira/browse/JBWS-663

          • 2. Re:
            Matt Boujonnier Newbie

            Thanks for the answer, I was about to post a question related to the client generation for the same WSDL.

            As you mentionned in the bug report, yep, I saw while debugging that the soap headers, correctly "inserted" into the operation interface as parameters using wscompile features "donotunwrap,searchschema,explicitcontext" are not taken into account by the jboss WSDL parser which cause a conflict while processing passed parameters (org.jboss.webservice.deployment.OperationDescription) and SOAP client generation.

            So, as I understand, it could be the same bug (?)

            Thx.

            • 3. Re:
              Matt Boujonnier Newbie

              Hum, maybe it was not clear but with the good features, wscompile generates this proper interface (which takes into account soap headers) :

              public interface SMSTextMessagingSoap extends java.rmi.Remote {
              
              public com.strikeiron.ws.SendMessageResponse endMessage(
              com.strikeiron.ws.SendMessage parameters,
              com.strikeiron.ws.LicenseInfo licenseInfo,
              com.strikeiron.ws.holders.ResponseInfoHolder responseInfo,
              com.strikeiron.ws.holders.SubscriptionInfoHolder subscriptionInfo)
              throws java.rmi.RemoteException;
              


              But that's not the case of the JBOSS WSDL parser which only waits for 1 input parameter SendMessage parameters.

              AxisClientProxy.proxyParams2CallParams(Object[] proxyParams)
              
               for (int i = 0; proxyParams != null && i < proxyParams.length; i++)
               {
               Object param = proxyParams;
               ParameterDesc paramDesc = opDesc.getParameter(i);
               if (paramDesc == null)
               throw new ServiceException("Cannot obtain parameter " + i + " for: " + opDesc);
              
               Caused by: javax.xml.rpc.ServiceException: Cannot obtain parameter 1 for:
               OperationDesc
               name: null
               returnQName: {http://www.strikeiron.com}SendMessageResponse
               returnType: {http://www.strikeiron.com}SendMessageResponse
               returnClass: class com.strikeiron.ws.SendMessageResponse
               elementQName:null
               soapAction: null
               style: document
               use: literal
               numInParams: 1
               method:null
              
               ParameterDesc
               name: {http://www.strikeiron.com}SendMessage
               typeEntry: null
               mode: IN
               isReturn: false
               typeQName: {http://www.strikeiron.com}SendMessage
               javaType: class com.strikeiron.ws.SendMessage
               inHeader: false
               outHeader: false
              
              


              Hope that helps.