3 Replies Latest reply on Jan 26, 2005 8:34 AM by Gurprit Singh

    wscompile/wsdl/ws4ee questions...

    Ryan Newbie

      I think I'm finally getting the hang of creating a service, but I'm just not positive what files to edit; I want to post it to the group first, then see if it's right. If so, I'll generate a page on the wiki explaining what I did since there's a large gap between how to do it and why. :)

      In any case, I implemented my Java service endpoint classes. I ran it through wscompile using the -define and -mapping option through an ant task. This generated both a .wsdl and jaxrpc-mapping.xml file. These files are used in combination by JBoss to create the .wsdd file that's stored in the server's data/wsdl directory.

      Using wscompile, it places definitions of helper structs (complex types) in the wsdl and mapping file such as XXX_ResponseStruct and XXX_RequestStruct. For example, the complex type getProfiles is mapped to Java object getProfiles_ResponseStruct, etc. The problem of course arises is that these files aren't actually generated so when JBoss creates the .wsdd file, it can't find the actual Java class since they weren't generated and hence, it ignores the mapping.

      <!-- Class not found, ignore type mapping
       <typeMapping
       qname='ns2:getProfiles' xmlns:ns2='http://service.profiles/types'
       type='java:profiles.service.endpoint.ProfileWebServiceInterface_getProfiles_RequestStruct'
       serializer='null'
       deserializer='null'
       encodingStyle=''>
       <typeDesc>
       <elementDesc fieldName='String_1' xmlName='String_1'/>
       <elementOrder> <element name='String_1'/>
       </elementOrder> </typeDesc>
       </typeMapping>
       -->
      


      Does this mean I have to completely edit the .wsdl that was created and the mapping file to remove references to these created structs?

      or

      Does this mean that I have to use the gen:server option on wscompile because I know that using this, it generates all the server artifacts, etc. There's a disconnect as to whether I have to use gen:server or if I can edit the wsdl to accomplish creating the service.

      I figure someone else must have the same questions I do. :) Btw, I'm creating a document/literal service using JBoss 4.0.1 with jwsdp 1.5

      Any help would be greatly appreciated,
      Ryan

        • 1. Re: wscompile/wsdl/ws4ee questions...
          Kunarak Osatapirat Newbie

          hi kanno,
          i've the same problem as u. i tried -gen:server with wscompile and package all xxx_Struct class in .war file(doesn't include ws4ee-deployment.xml). Anything look well i can call web service but return type become xxx_ReponseStruct (cause it's defined in mapping file). so "ClassCastException" occurs while i try to cast it into my custom type.

          i think this approach will work in one way communication (call void method). Another way i'm trying to do is override custom-mapping file by ws4ee-deployment.xml (i wish it help me to complete my work...). i'll post it if it success...

          Ken

          • 2. Re: wscompile/wsdl/ws4ee questions...
            Ryan Newbie

            Ok, after going through all the examples, I sorta see what's going on with the assorted mapping files, etc. Since apparently the automatically generated wsdl creates a wsdl that validates a message of

            <getProfiles>
             <String_1>*BLAH*</String_1>
            </getProfiles>
            


            I can't just use this type mapping

            <typeMapping qname='ns1:getProfiles' xmlns:ns1='http://namespace'
             type='java:java.lang.String'
             serializer='org.apache.axis.encoding.ser.SimpleSerializerFactory'
             deserializer='org.apache.axis.encoding.ser.SimpleDeserializerFactory'
             encodingStyle=''>
            </typeMapping>
            


            because the value between the tags isn't a string type. Is it standard to just edit the wsdl file or to edit the typemappings via the ws4ee-deployment file?

            • 3. Re: wscompile/wsdl/ws4ee questions...
              Gurprit Singh Newbie

              HI, I am facing the similar problem. I am using String as inout and out put param


              My Jaxrpx-mapping.xml looks like

              <?xml version="1.0" encoding="UTF-8"?>
              <java-wsdl-mapping xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:impl="http://www.skandia.co.uk/wrap/standingdata" xmlns:port="http://www.skandia.co.uk/wrap/portfolio" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
               http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd" version="1.1">
               <package-mapping>
               <package-type>uk.co.skandia.wraptools.investment</package-type>
               <namespaceURI>http://www.skandia.co.uk/wrap/InvestmentService</namespaceURI>
               </package-mapping>
               <package-mapping>
               <package-type>uk.co.skandia.wraptools.riskassessment</package-type>
               <namespaceURI>http://www.skandia.co.uk/wrap/RiskAssessmentService</namespaceURI>
               </package-mapping>
               <java-xml-type-mapping>
               <java-type>java.lang.String</java-type>
               <root-type-qname>impl:getAvailableFundFiltersReturn</root-type-qname>
               <qname-scope>element</qname-scope>
               </java-xml-type-mapping>
               <java-xml-type-mapping>
               <java-type>java.lang.String</java-type>
               <root-type-qname>port:getRiskQuestionnaireReturn</root-type-qname>
               <qname-scope>element</qname-scope>
               </java-xml-type-mapping>
               <java-xml-type-mapping>
               <java-type>java.lang.String</java-type>
               <root-type-qname>port:in0</root-type-qname>
               <qname-scope>element</qname-scope>
               </java-xml-type-mapping>
              </java-wsdl-mapping>
              


              i have generated WSDl using Axis Java2Wsdl.
              <?xml version="1.0" encoding="UTF-8"?>
              <wsdl:definitions targetNamespace="http://www.skandia.co.uk/wrap/InvestmentService" xmlns:impl="http://www.skandia.co.uk/wrap/InvestmentService" xmlns:intf="http://www.skandia.co.uk/wrap/InvestmentService" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
               <wsdl:types>
               <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.skandia.co.uk/wrap/InvestmentService">
               <element name="in0" type="xsd:string"/>
               <element name="saveReturn" type="xsd:string"/>
               <element name="in0" type="xsd:string"/>
               <element name="deleteReturn" type="xsd:string"/>
               <element name="in0" type="xsd:string"/>
               <element name="getAvailableFundFiltersReturn" type="xsd:string"/>
               <element name="in0" type="xsd:string"/>
               <element name="in0" type="xsd:string"/>
               <element name="getFundListReturn" type="xsd:string"/>
               <element name="in0" type="xsd:string"/>
               <element name="getFundDetailsReturn" type="xsd:string"/>
               <element name="in0" type="xsd:string"/>
               <element name="getFundPerformanceReturn" type="xsd:string"/>
               <element name="in0" type="xsd:string"/>
               <element name="getProductCategoriesAndFundRangesReturn" type="xsd:string"/>
               <element name="in0" type="xsd:string"/>
               <element name="getAssetClassesReturn" type="xsd:string"/>
               <element name="in0" type="xsd:string"/>
               <element name="getSectorPerformanceReturn" type="xsd:string"/>
               </schema>
               </wsdl:types>
              
               <wsdl:message name="getAvailableFundFiltersRequest">
              
               <wsdl:part name="in0" element="impl:in0"/>
              
               </wsdl:message>
              
               <wsdl:message name="getAssetClassesRequest">
              
               <wsdl:part name="in0" element="impl:in0"/>
              
               </wsdl:message>
              
               <wsdl:message name="getProductCategoriesAndFundRangesRequest">
              
               <wsdl:part name="in0" element="impl:in0"/>
              
               </wsdl:message>
              
               <wsdl:message name="getFundListResponse">
              
               <wsdl:part name="getFundListReturn" element="impl:getFundListReturn"/>
              
               </wsdl:message>
              
               <wsdl:message name="getSectorPerformanceResponse">
              
               <wsdl:part name="getSectorPerformanceReturn" element="impl:getSectorPerformanceReturn"/>
              
               </wsdl:message>
              
               <wsdl:message name="getFundPerformanceRequest">
              
               <wsdl:part name="in0" element="impl:in0"/>
              
               </wsdl:message>
              
               <wsdl:message name="setAvailableFundFiltersRequest">
              
               <wsdl:part name="in0" element="impl:in0"/>
              
               </wsdl:message>
              
               <wsdl:message name="getFundListRequest">
              
               <wsdl:part name="in0" element="impl:in0"/>
              
               </wsdl:message>
              
               <wsdl:message name="deleteResponse">
              
               <wsdl:part name="deleteReturn" element="impl:deleteReturn"/>
              
               </wsdl:message>
              
               <wsdl:message name="saveResponse">
              
               <wsdl:part name="saveReturn" element="impl:saveReturn"/>
              
               </wsdl:message>
              
               <wsdl:message name="getAvailableFundFiltersResponse">
              
               <wsdl:part name="getAvailableFundFiltersReturn" element="impl:getAvailableFundFiltersReturn"/>
              
               </wsdl:message>
              
               <wsdl:message name="getFundDetailsResponse">
              
               <wsdl:part name="getFundDetailsReturn" element="impl:getFundDetailsReturn"/>
              
               </wsdl:message>
              
               <wsdl:message name="getProductCategoriesAndFundRangesResponse">
              
               <wsdl:part name="getProductCategoriesAndFundRangesReturn" element="impl:getProductCategoriesAndFundRangesReturn"/>
              
               </wsdl:message>
              
               <wsdl:message name="getSectorPerformanceRequest">
              
               <wsdl:part name="in0" element="impl:in0"/>
              
               </wsdl:message>
              
               <wsdl:message name="getAssetClassesResponse">
              
               <wsdl:part name="getAssetClassesReturn" element="impl:getAssetClassesReturn"/>
              
               </wsdl:message>
              
               <wsdl:message name="getFundPerformanceResponse">
              
               <wsdl:part name="getFundPerformanceReturn" element="impl:getFundPerformanceReturn"/>
              
               </wsdl:message>
              
               <wsdl:message name="setAvailableFundFiltersResponse">
              
               </wsdl:message>
              
               <wsdl:message name="deleteRequest">
              
               <wsdl:part name="in0" element="impl:in0"/>
              
               </wsdl:message>
              
               <wsdl:message name="saveRequest">
              
               <wsdl:part name="in0" element="impl:in0"/>
              
               </wsdl:message>
              
               <wsdl:message name="getFundDetailsRequest">
              
               <wsdl:part name="in0" element="impl:in0"/>
              
               </wsdl:message>
              
               <wsdl:portType name="InvestmentService">
              
               <wsdl:operation name="save" parameterOrder="in0">
              
               <wsdl:input name="saveRequest" message="impl:saveRequest"/>
              
               <wsdl:output name="saveResponse" message="impl:saveResponse"/>
              
               </wsdl:operation>
              
               <wsdl:operation name="delete" parameterOrder="in0">
              
               <wsdl:input name="deleteRequest" message="impl:deleteRequest"/>
              
               <wsdl:output name="deleteResponse" message="impl:deleteResponse"/>
              
               </wsdl:operation>
              
               <wsdl:operation name="getAvailableFundFilters" parameterOrder="in0">
              
               <wsdl:input name="getAvailableFundFiltersRequest" message="impl:getAvailableFundFiltersRequest"/>
              
               <wsdl:output name="getAvailableFundFiltersResponse" message="impl:getAvailableFundFiltersResponse"/>
              
               </wsdl:operation>
              
               <wsdl:operation name="setAvailableFundFilters" parameterOrder="in0">
              
               <wsdl:input name="setAvailableFundFiltersRequest" message="impl:setAvailableFundFiltersRequest"/>
              
               <wsdl:output name="setAvailableFundFiltersResponse" message="impl:setAvailableFundFiltersResponse"/>
              
               </wsdl:operation>
              
               <wsdl:operation name="getFundList" parameterOrder="in0">
              
               <wsdl:input name="getFundListRequest" message="impl:getFundListRequest"/>
              
               <wsdl:output name="getFundListResponse" message="impl:getFundListResponse"/>
              
               </wsdl:operation>
              
               <wsdl:operation name="getFundDetails" parameterOrder="in0">
              
               <wsdl:input name="getFundDetailsRequest" message="impl:getFundDetailsRequest"/>
              
               <wsdl:output name="getFundDetailsResponse" message="impl:getFundDetailsResponse"/>
              
               </wsdl:operation>
              
               <wsdl:operation name="getFundPerformance" parameterOrder="in0">
              
               <wsdl:input name="getFundPerformanceRequest" message="impl:getFundPerformanceRequest"/>
              
               <wsdl:output name="getFundPerformanceResponse" message="impl:getFundPerformanceResponse"/>
              
               </wsdl:operation>
              
               <wsdl:operation name="getProductCategoriesAndFundRanges" parameterOrder="in0">
              
               <wsdl:input name="getProductCategoriesAndFundRangesRequest" message="impl:getProductCategoriesAndFundRangesRequest"/>
              
               <wsdl:output name="getProductCategoriesAndFundRangesResponse" message="impl:getProductCategoriesAndFundRangesResponse"/>
              
               </wsdl:operation>
              
               <wsdl:operation name="getAssetClasses" parameterOrder="in0">
              
               <wsdl:input name="getAssetClassesRequest" message="impl:getAssetClassesRequest"/>
              
               <wsdl:output name="getAssetClassesResponse" message="impl:getAssetClassesResponse"/>
              
               </wsdl:operation>
              
               <wsdl:operation name="getSectorPerformance" parameterOrder="in0">
              
               <wsdl:input name="getSectorPerformanceRequest" message="impl:getSectorPerformanceRequest"/>
              
               <wsdl:output name="getSectorPerformanceResponse" message="impl:getSectorPerformanceResponse"/>
              
               </wsdl:operation>
              
               </wsdl:portType>
              
               <wsdl:binding name="WrapInvestmentServiceSoapBinding" type="impl:InvestmentService">
              
               <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
              
               <wsdl:operation name="save">
              
               <wsdlsoap:operation soapAction=""/>
              
               <wsdl:input name="saveRequest">
              
               <wsdlsoap:body use="literal" namespace="http://www.skandia.co.uk/wrap/InvestmentService"/>
              
               </wsdl:input>
              
               <wsdl:output name="saveResponse">
              
               <wsdlsoap:body use="literal" namespace="http://www.skandia.co.uk/wrap/InvestmentService"/>
              
               </wsdl:output>
              
               </wsdl:operation>
              
               <wsdl:operation name="delete">
              
               <wsdlsoap:operation soapAction=""/>
              
               <wsdl:input name="deleteRequest">
              
               <wsdlsoap:body use="literal" namespace="http://www.skandia.co.uk/wrap/InvestmentService"/>
              
               </wsdl:input>
              
               <wsdl:output name="deleteResponse">
              
               <wsdlsoap:body use="literal" namespace="http://www.skandia.co.uk/wrap/InvestmentService"/>
              
               </wsdl:output>
              
               </wsdl:operation>
              
               <wsdl:operation name="getAvailableFundFilters">
              
               <wsdlsoap:operation soapAction=""/>
              
               <wsdl:input name="getAvailableFundFiltersRequest">
              
               <wsdlsoap:body use="literal" namespace="http://www.skandia.co.uk/wrap/InvestmentService"/>
              
               </wsdl:input>
              
               <wsdl:output name="getAvailableFundFiltersResponse">
              
               <wsdlsoap:body use="literal" namespace="http://www.skandia.co.uk/wrap/InvestmentService"/>
              
               </wsdl:output>
              
               </wsdl:operation>
              
               <wsdl:operation name="setAvailableFundFilters">
              
               <wsdlsoap:operation soapAction=""/>
              
               <wsdl:input name="setAvailableFundFiltersRequest">
              
               <wsdlsoap:body use="literal" namespace="http://www.skandia.co.uk/wrap/InvestmentService"/>
              
               </wsdl:input>
              
               <wsdl:output name="setAvailableFundFiltersResponse">
              
               <wsdlsoap:body use="literal" namespace="http://www.skandia.co.uk/wrap/InvestmentService"/>
              
               </wsdl:output>
              
               </wsdl:operation>
              
               <wsdl:operation name="getFundList">
              
               <wsdlsoap:operation soapAction=""/>
              
               <wsdl:input name="getFundListRequest">
              
               <wsdlsoap:body use="literal" namespace="http://www.skandia.co.uk/wrap/InvestmentService"/>
              
               </wsdl:input>
              
               <wsdl:output name="getFundListResponse">
              
               <wsdlsoap:body use="literal" namespace="http://www.skandia.co.uk/wrap/InvestmentService"/>
              
               </wsdl:output>
              
               </wsdl:operation>
              
               <wsdl:operation name="getFundDetails">
              
               <wsdlsoap:operation soapAction=""/>
              
               <wsdl:input name="getFundDetailsRequest">
              
               <wsdlsoap:body use="literal" namespace="http://www.skandia.co.uk/wrap/InvestmentService"/>
              
               </wsdl:input>
              
               <wsdl:output name="getFundDetailsResponse">
              
               <wsdlsoap:body use="literal" namespace="http://www.skandia.co.uk/wrap/InvestmentService"/>
              
               </wsdl:output>
              
               </wsdl:operation>
              
               <wsdl:operation name="getFundPerformance">
              
               <wsdlsoap:operation soapAction=""/>
              
               <wsdl:input name="getFundPerformanceRequest">
              
               <wsdlsoap:body use="literal" namespace="http://www.skandia.co.uk/wrap/InvestmentService"/>
              
               </wsdl:input>
              
               <wsdl:output name="getFundPerformanceResponse">
              
               <wsdlsoap:body use="literal" namespace="http://www.skandia.co.uk/wrap/InvestmentService"/>
              
               </wsdl:output>
              
               </wsdl:operation>
              
               <wsdl:operation name="getProductCategoriesAndFundRanges">
              
               <wsdlsoap:operation soapAction=""/>
              
               <wsdl:input name="getProductCategoriesAndFundRangesRequest">
              
               <wsdlsoap:body use="literal" namespace="http://www.skandia.co.uk/wrap/InvestmentService"/>
              
               </wsdl:input>
              
               <wsdl:output name="getProductCategoriesAndFundRangesResponse">
              
               <wsdlsoap:body use="literal" namespace="http://www.skandia.co.uk/wrap/InvestmentService"/>
              
               </wsdl:output>
              
               </wsdl:operation>
              
               <wsdl:operation name="getAssetClasses">
              
               <wsdlsoap:operation soapAction=""/>
              
               <wsdl:input name="getAssetClassesRequest">
              
               <wsdlsoap:body use="literal" namespace="http://www.skandia.co.uk/wrap/InvestmentService"/>
              
               </wsdl:input>
              
               <wsdl:output name="getAssetClassesResponse">
              
               <wsdlsoap:body use="literal" namespace="http://www.skandia.co.uk/wrap/InvestmentService"/>
              
               </wsdl:output>
              
               </wsdl:operation>
              
               <wsdl:operation name="getSectorPerformance">
              
               <wsdlsoap:operation soapAction=""/>
              
               <wsdl:input name="getSectorPerformanceRequest">
              
               <wsdlsoap:body use="literal" namespace="http://www.skandia.co.uk/wrap/InvestmentService"/>
              
               </wsdl:input>
              
               <wsdl:output name="getSectorPerformanceResponse">
              
               <wsdlsoap:body use="literal" namespace="http://www.skandia.co.uk/wrap/InvestmentService"/>
              
               </wsdl:output>
              
               </wsdl:operation>
              
               </wsdl:binding>
              
               <wsdl:service name="InvestmentServiceService">
              
               <wsdl:port name="WrapInvestmentService" binding="impl:WrapInvestmentServiceSoapBinding">
              
               <wsdlsoap:address location="http://uk17402.skandia.co.uk:8080/ws4ee/services/WrapInvestmentService"/>
              
               </wsdl:port>
              
               </wsdl:service>
              
              </wsdl:definitions>
              



              but when try to deploy it gives warning
              WARN [TypeMappingDescription] Class not found: uk.co.skandia.wraptools.investment.getSectorPerformanceReturn

              i had a look at the generated WSDD file
              <!-- Ignore type mapping
               <typeMapping
               qname='ns1:calcRiskResultReturn' xmlns:ns1='http://www.skandia.co.uk/wrap/RiskAssessmentService'
               type='java:uk.co.skandia.wraptools.riskassessment.calcRiskResultReturn'
               serializer='null'
               deserializer='null'
               encodingStyle=''>
               </typeMapping>
               -->


              probably it couldn't fine the class
              uk.co.skandia.wraptools.riskassessment.calcRiskResultReturn'
              but why it is looking for this class when return type is a String