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 :

      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:

       <s:schema xmlns:s="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.strikeiron.com">
       <s:element name="SendMessage">
       <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"/>
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
       <operation name="SendMessage">
      <soap:operation soapAction="http://www.strikeiron.com/SendMessage" style="document"/>
      <soap:body use="literal"/>
      <soap:header message="s0:LicenseInfoMessage" part="LicenseInfo" use="literal"/>
      <soap:body use="literal"/>
      <soap:header message="s0:SendMessageResponseInfo" part="ResponseInfo" use="literal"/>
      <soap:header message="s0:SubscriptionInfoMessage" part="SubscriptionInfo" use="literal"/>

      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' />
       qname='ns1:SendMessage' xmlns:ns1='http://www.strikeiron.com'
       <elementDesc fieldName='toNumber' xmlName='ToNumber'/>
       <elementDesc fieldName='fromNumber' xmlName='FromNumber'/>
       <elementDesc fieldName='fromName' xmlName='FromName'/>
       <elementDesc fieldName='messageText' xmlName='MessageText'/>
       <element name='toNumber'/>
       <element name='fromNumber'/>
       <element name='fromName'/>
       <element name='messageText'/>
       qname='ns1:SendMessageResponse' xmlns:ns1='http://www.strikeiron.com'
       <elementDesc fieldName='sendMessageResult' xmlName='SendMessageResult'/>
       <element name='sendMessageResult'/>

      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 !


        • 1. Re:
          Thomas Diesler Master

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


          • 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 (?)


            • 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:
               name: null
               returnQName: {http://www.strikeiron.com}SendMessageResponse
               returnType: {http://www.strikeiron.com}SendMessageResponse
               returnClass: class com.strikeiron.ws.SendMessageResponse
               soapAction: null
               style: document
               use: literal
               numInParams: 1
               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.