This discussion is archived
11 Replies Latest reply: Jan 28, 2009 5:18 AM by 843833 Branched to a new discussion. RSS

Spot the error in the WSDL document

843833 Newbie
Currently Being Moderated
Hi,

I have been staring at this document for about 1/2 an hour now and cannot spot what is wrong. I simple want two methods. One which runs a simulation and outputs files to a given folder (RunSimulation). The second should retreive the files and send then back to the client (ReturnFiles) Please will someone with a fresh pair of eyes try to spot why this error is occuring.

When I run the following command:
wscompile -import -verbose -keep -f:wsi -mapping ./build/WEB-INF/cimmsimservice-mapping.xml -s ./src -d ./build/WEB-INF/classes config.xml

I get this error:
warning: ignoring operation "ReturnFile": message part does not refer to a schema element declaration
[ServiceInterfaceGenerator: creating service interface: cimmsim.cimmsimservice.CimmsimService]
[CustomExceptionGenerator: generating CustomException for: cimmsim.cimmsimservice.CimmsimFaultMessage]



WSDL document
<?xml version="1.0" encoding="UTF-8"?>
<definitions
    name="cimmsim"
    targetNamespace="http://www.immunologygrid.org/cimmsimservice"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tns="http://www.immunologygrid.org/cimmsimservice"
    xmlns:types="http://www.immunologygrid.org/cimmsimservice/types"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">

        <types>
                <xsd:schema targetNamespace="http://www.immunologygrid.org/cimmsimservice/types" elementFormDefault="qualified">

                        <xsd:annotation>
                                <xsd:documentation xml:lang="en">C-ImmSim Service</xsd:documentation>
                        </xsd:annotation>

                        <xsd:element name="cimmsim_results" type="xsd:string"/>
                        <xsd:element name="FileInput" type="xsd:string"/>
                        <xsd:element name="cimmsimFault" type="xsd:string" />
                        <xsd:element name="stringID" type="xsd:string" />
                        <xsd:element name="filesFault" type="xsd:string" />^

                </xsd:schema>
        </types>

        <!-- Request message -->
        <message name="CimmsimRequestMessage">
                <part name="parameter" element="types:FileInput" />
                <part name="datfile" type="xsd:base64Binary"/>
        </message>
 
        <!-- Response message -->
        <message name="CimmsimResponseMessage">
                <part name="parameter2" element="types:cimmsim_results" />
        </message>
 
        <!-- Fault messages -->
        <message name="CimmsimFaultMessage">
                <part name="cimmsimFault" element="types:cimmsimFault" />
        </message>

        <message name="getFilesMessage">
                <part name="body" element="types:stringID" />
        </message>

        <message name="getFilesResponse">
                <part name="body" type="xsd:base64Binary" />
        </message>

        <!-- Fault messages -->
        <message name="returnFileFaultMessage">
                <part name="fileFault" element="types:filesFault" />
        </message>

  
  
        <!-- Simple Service PortType definition -->

        <portType name="CimmsimServicePortType">
                <operation name="RunSimulation">
                        <input message="tns:CimmsimRequestMessage"/>
                        <output message="tns:CimmsimResponseMessage"/>
                        <fault name="cimmsimFault" message="tns:CimmsimFaultMessage"/>
                </operation>
                <operation name="ReturnFile">
                        <input message="tns:getFilesMessage"/>
                        <output message="tns:getFilesResponse"/>
                        <fault name="fileFault" message="tns:returnFileFaultMessage"/>
                </operation>
        </portType>

        <binding name="CimmsimServicePortTypeSOAPBinding" type="tns:CimmsimServicePortType">
                <documentation>SOAP Binding for the CimmsimServicePortType</documentation>
                <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

                <operation name="RunSimulation">
                        <soap:operation soapAction="CimmsimServicePortType#RunSimulation"/>
                                <input>
                                        <mime:multipartRelated>
                                                <mime:part>
                                                        <soap:body parts="parameter" use="literal"/>
                                                </mime:part>
                                                <mime:part>
                                                        <mime:content part="datfile" type="text/plain"/>
                                                </mime:part>
                                        </mime:multipartRelated>
                                </input>
                                <output>
                                        <soap:body  use="literal"/>
                                </output>
                                <fault name="cimmsimFault">
                                        <soap:fault name="cimmsimFault" use="literal" /> 
                                </fault>
                </operation>

                <operation name="ReturnFile">
                        <soap:operation soapAction="CimmsimServicePortType#ReturnFile"/>
                                <input>
                                        <soap:body parts="body" use="literal"/>
                                </input>
                                <output>
                                        <soap:body parts="body" use="literal"/>
                                </output>
                                <fault name="fileFault">
                                        <soap:fault name="fileFault" use="literal" />
                                </fault>
                </operation>  
        </binding>

        <service name="CimmsimService">
                <port name="CimmsimServicePortTypeSOAPPort" binding="tns:CimmsimServicePortTypeSOAPBinding">
                        <soap:address location="http://localhost:5051/cimmsim/cimmsimservice/"/>
                </port>
        </service>

</definitions>
  • 1. Re: Spot the error in the WSDL document
    843833 Newbie
    Currently Being Moderated
    Hi!

    wsimport (in jaxws) gives this error:

    Invalid wsdl:operation "ReturnFile": its a document-literal operation, message part must refer to a schema element declaration

    You could try to remove the -f:wsi option to see if the error persists..

    regards!

    /Ole
  • 2. Re: Spot the error in the WSDL document
    843833 Newbie
    Currently Being Moderated
    Hi Ole,

    I have just tried what you suggested, with the same results!
    Could you explain what you mean by "ReturnFile is a document literal operation"?
    The other method "RunSimulation" is almost identical, but the interfaces are fine for "RunSimulation"

    Thanks for you help
    markyhb
  • 3. Re: Spot the error in the WSDL document
    843833 Newbie
    Currently Being Moderated
    ok.. i made the following changes:

    - add the following element to you types:
    <xsd:element name="responseFile" type="xsd:base64Binary"/>

    - change the getResponseFiles message to
    <message name="getFilesResponse">
    <part name="body" element="types:responseFile" />
    </message>

    everything then worked fine in both jaxws and jwsdp

    hope this helps..

    regards!

    /Ole
  • 4. Re: Spot the error in the WSDL document
    843833 Newbie
    Currently Being Moderated
    Ole!,

    Thanks very much for your help, The changes you suggested worked!!
    Woohoo

    Regards
    markyhb
  • 5. Re: Spot the error in the WSDL document
    843833 Newbie
    Currently Being Moderated
    glad I could help, good luck!

    /Ole
    eviware.com
  • 6. Re: Spot the error in the WSDL document
    843833 Newbie
    Currently Being Moderated
    Hi,
    I too am facing a similar issue with jax ws. My wsdl file works fine with axis client but i need to generate a jax ws client.

    My wsdl file looks like:
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions name="DomainValueService" targetNamespace="http://sanlam.co.za/domainvalue/bc/service/intf/1" xmlns:dto="http://sanlam.co.za/domainvalue/bc/service/dto/1" xmlns:dto-errinfo="http://sanlam.co.za/common/errorinfo/tc/dto/1" xmlns:dto-ictx="http://sanlam.co.za/common/interactioncontext/tc/dto/1" xmlns:intf="http://sanlam.co.za/domainvalue/bc/service/intf/1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
              Domain Value component services for fetching domain values based
              on attribute name.
         </wsdl:documentation>
    <wsdl:types>
    <xsd:schema targetNamespace="http://sanlam.co.za/domainvalue/bc/service/intf/1" xmlns:intf="http://sanlam.co.za/domainvalue/bc/service/intf/1" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
    <xsd:schema elementFormDefault="qualified" targetNamespace="http://sanlam.co.za/common/interactioncontext/tc/dto/1" version="1.0" xml:lang="en" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                   <xsd:element name="InteractionContext" type="dto-ictx:InteractionContext">
                        <xsd:annotation>
                             <xsd:documentation>
                                  Interaction context data transfer object element
                                  wrapper.
                             </xsd:documentation>
                        </xsd:annotation>
                   </xsd:element>
                   <xsd:complexType name="InteractionContext">
                        <xsd:sequence>
                             <xsd:element maxOccurs="1" minOccurs="1" name="correlationId" type="xsd:string">
                                  <xsd:annotation>
                                       <xsd:documentation>
                                            Message correlation id
                                       </xsd:documentation>
                                  </xsd:annotation>
                             </xsd:element>
                             <xsd:element maxOccurs="1" minOccurs="1" name="userId" type="xsd:string">
                                  <xsd:annotation>
                                       <xsd:documentation>
                                            User-id used for tracking.
                                       </xsd:documentation>
                                  </xsd:annotation>
                             </xsd:element>
                             <xsd:element maxOccurs="1" minOccurs="1" name="language" type="xsd:language">
                                  <xsd:annotation>
                                       <xsd:documentation>
                                            Language of the user
                                       </xsd:documentation>
                                  </xsd:annotation>
                             </xsd:element>
                             <xsd:element maxOccurs="1" minOccurs="0" name="securityContextId" type="xsd:string">
                                  <xsd:annotation>
                                       <xsd:documentation>
                                            User id in the security context
                                       </xsd:documentation>
                                  </xsd:annotation>
                             </xsd:element>
                        </xsd:sequence>
                   </xsd:complexType>
              </xsd:schema>
    <xsd:schema elementFormDefault="qualified" targetNamespace="http://sanlam.co.za/common/errorinfo/tc/dto/1" version="1.0" xml:lang="en" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                   <xsd:element name="ErrorInfo" type="dto-errinfo:ErrorInfo">
                        <xsd:annotation>
                             <xsd:documentation>
                                  Error information data transfer object element
                                  wrapper.
                             </xsd:documentation>
                        </xsd:annotation>
                   </xsd:element>
                   <xsd:complexType name="ErrorInfo">
                        <xsd:sequence>
                             <xsd:element maxOccurs="1" minOccurs="1" name="errorMessageType" type="xsd:string">
                                  <xsd:annotation>
                                       <xsd:documentation>
                                            Designates the severity of the error.
                                            (error, warning, information)
                                       </xsd:documentation>
                                  </xsd:annotation>
                             </xsd:element>
                             <xsd:element maxOccurs="1" minOccurs="1" name="errorCode" type="xsd:string">
                                  <xsd:annotation>
                                       <xsd:documentation>
                                            Code representing the error for easier
                                            tracking.
                                       </xsd:documentation>
                                  </xsd:annotation>
                             </xsd:element>
                             <xsd:element maxOccurs="1" minOccurs="1" name="errorMessageText" type="xsd:string">
                                  <xsd:annotation>
                                       <xsd:documentation>
                                            Specifies exactly what the error is.
                                       </xsd:documentation>
                                  </xsd:annotation>
                             </xsd:element>
                             <xsd:element maxOccurs="1" minOccurs="0" name="errorStackTrace" type="xsd:string">
                                  <xsd:annotation>
                                       <xsd:documentation>
                                            Holds stack trace for any exception that
                                            is converted to fault
                                       </xsd:documentation>
                                  </xsd:annotation>
                             </xsd:element>
                        </xsd:sequence>
                   </xsd:complexType>
              </xsd:schema>
    <xsd:schema elementFormDefault="qualified" targetNamespace="http://sanlam.co.za/domainvalue/bc/service/dto/1" version="1.0" xml:lang="en" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                   <xsd:import namespace="http://sanlam.co.za/common/interactioncontext/tc/dto/1"/>
                   <xsd:import namespace="http://sanlam.co.za/common/errorinfo/tc/dto/1"/>

                   <xsd:element name="DomainValue" type="dto:DomainValue">
                        <xsd:annotation>
                             <xsd:documentation>
                                  Domain Value info
                             </xsd:documentation>
                        </xsd:annotation>
                   </xsd:element>
                   <xsd:complexType name="DomainValue">
                        <xsd:sequence>
                             <xsd:element maxOccurs="1" minOccurs="0" name="domainValueKey" type="xsd:long"/>
                             <xsd:element maxOccurs="1" minOccurs="0" name="attributeName" type="xsd:string"/>
                             <xsd:element maxOccurs="1" minOccurs="0" name="shortName" type="xsd:string"/>
                             <xsd:element maxOccurs="1" minOccurs="0" name="displayName" type="xsd:string"/>
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:element name="GetDomainValueRequest" type="dto:GetDomainValueRequest">
                        <xsd:annotation>
                             <xsd:documentation>
                                  Get domain value request wrapper
                             </xsd:documentation>
                        </xsd:annotation>
                   </xsd:element>
                   <xsd:complexType name="GetDomainValueRequest">
                        <xsd:sequence>
                             <xsd:element maxOccurs="1" minOccurs="1" name="attributeName" type="xsd:string"/>
                             <xsd:element maxOccurs="1" minOccurs="1" name="interactionContext" type="dto-ictx:InteractionContext"/>
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:element name="GetDomainValueResponse" type="dto:GetDomainValueResponse">
                        <xsd:annotation>
                             <xsd:documentation>
                                  Get domain value response wrapper
                             </xsd:documentation>
                        </xsd:annotation>
                   </xsd:element>
                   <xsd:complexType name="GetDomainValueResponse">
                        <xsd:sequence>
                             <xsd:element maxOccurs="1" minOccurs="1" name="attributeName" type="xsd:string"/>
                             <xsd:element maxOccurs="unbounded" minOccurs="0" name="domainValueList" type="dto:DomainValue"/>
                             <xsd:element maxOccurs="1" minOccurs="1" name="interactionContext" type="dto-ictx:InteractionContext"/>
                        </xsd:sequence>
                   </xsd:complexType>
              </xsd:schema>
    </wsdl:types>
    <wsdl:message name="GetDomainValueOutput">
    <wsdl:part name="GetDomainValueOutput" type="dto:GetDomainValueResponse"/>
    </wsdl:message>
    <wsdl:message name="GetDomainValueInput">
    <wsdl:part name="GetDomainValueInput" type="dto:GetDomainValueRequest"/>
    </wsdl:message>
    <wsdl:message name="ErrorInfo">
    <wsdl:part element="dto-errinfo:ErrorInfo" name="ErrorInfo"/>
    </wsdl:message>
    <wsdl:portType name="DomainValueService">
    <wsdl:operation name="getDomainValue">
    <wsdl:input message="intf:GetDomainValueInput" name="GetDomainValueInput"/>
    <wsdl:output message="intf:GetDomainValueOutput" name="GetDomainValueOutput"/>
    <wsdl:fault message="intf:ErrorInfo" name="ErrorInfo"/>
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="DomainValueServiceBinding" type="intf:DomainValueService">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="getDomainValue">
    <soap:operation/>
    <wsdl:input name="GetDomainValueInput">
    <soap:body use="literal"/>
    </wsdl:input>
    <wsdl:output name="GetDomainValueOutput">
    <soap:body use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="DomainValueServiceBinding">
    <wsdl:port binding="intf:DomainValueServiceBinding" name="DomainValueServicePort">
    <soap:address location="http://x0014642:9081/DomainValueMediationWeb/sca/DomainValueService"/>
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>


    I am getting the following error:
    C:\>wsimport -verbose -keep -s "C:\poc_code" -p za.co.
    sanlam.cca.ui.domainvalue http://x0014642:9081/DomainValueMediationWeb/sca/Domai
    nValueService?wsdl
    Invalid wsdl:operation "getDomainValue": its a document-literal operation, mess
    age part must refer to a schema element declaration
    at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.fail(WSDLModeler.
    java:2785)
    at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.processLiteralSOA
    POperation(WSDLModeler.java:673)
    at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.processSOAPOperat
    ion(WSDLModeler.java:627)
    at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.processPort(WSDLM
    odeler.java:520)
    at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.processService(WS
    DLModeler.java:286)
    at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.internalBuildMode
    l(WSDLModeler.java:255)
    at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLMo
    deler.java:178)
    at com.sun.tools.ws.processor.config.ModelInfo.buildModel(ModelInfo.java
    :85)
    at com.sun.tools.ws.processor.Processor.runModeler(Processor.java:79)
    at com.sun.tools.ws.wscompile.CompileTool.run(CompileTool.java:497)
    at com.sun.tools.ws.util.ToolBase.run(ToolBase.java:54)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.sun.tools.ws.Invoker.main(Invoker.java:41)
    at com.sun.tools.ws.WsImport.main(WsImport.java:28)
    error: Invalid wsdl:operation "getDomainValue": its a document-literal operation
    , message part must refer to a schema element declaration


    Could you suggest me what could be the issue. Is it a problem with jax-ws or with the wsdl?

    Thanks,
    Sushil
  • 7. Re: Spot the error in the WSDL document
    843833 Newbie
    Currently Being Moderated
    The fix is to replace the following in your wsdl (Replace type=) (To element=) below:

    From:
    <wsdl:message name="GetDomainValueOutput">
    <wsdl:part name="GetDomainValueOutput" type="dto:GetDomainValueResponse"/>
    </wsdl:message>
    <wsdl:message name="GetDomainValueInput">
    <wsdl:part name="GetDomainValueInput" type="dto:GetDomainValueRequest"/>

    To:
    <wsdl:message name="GetDomainValueOutput">
    <wsdl:part name="GetDomainValueOutput" element="dto:GetDomainValueResponse"/>
    </wsdl:message>
    <wsdl:message name="GetDomainValueInput">
    <wsdl:part name="GetDomainValueInput" element="dto:GetDomainValueRequest"/>
  • 8. Re: Spot the error in the WSDL document
    843833 Newbie
    Currently Being Moderated
    Hi!! I have this WSDL :


    <?xml version="1.0" encoding="UTF-8"?>
    <definitions name="BpelModul" targetNamespace="http://j2ee.netbeans.org/wsdl/BpelModul"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:tns="http://j2ee.netbeans.org/wsdl/BpelModul"
    xmlns:ns="http://xml.netbeans.org/schema/BpelModul"
    xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
    <types>
    <xsd:schema targetNamespace="http://j2ee.netbeans.org/wsdl/BpelModul">
    <xsd:import namespace="http://xml.netbeans.org/schema/BpelModul" schemaLocation="BpelModul.xsd"/>
    </xsd:schema>
    </types>
    <message name="BpelModulOperationRequest">
    <part name="request" type="ns:cpv"/>
    </message>
    <message name="BpelModulOperationReply">
    <part name="response" type="ns:supplierArray"/>
    </message>
    <portType name="BpelModulPortType">
    <operation name="BpelModulOperation">
    <input name="input1" message="tns:BpelModulOperationRequest"/>
    <output name="output1" message="tns:BpelModulOperationReply"/>
    </operation>
    </portType>
    <binding name="SoapBinding" type="tns:BpelModulPortType">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    <operation name="BpelModulOperation">
    <input name="input1">
    <soap:body use="literal"/>
    </input>
    <output name="output1">
    <soap:body use="literal"/>
    </output>
    </operation>
    </binding>
    <service name="BpelModul">
    <port name="BpelModulPort" binding="tns:SoapBinding">
    <soap:address location="http://localhost:18181/BpelModul/BpelModul"/>
    </port>
    </service>
    <plnk:partnerLinkType name="BpelModul">
    <!-- A partner link type is automatically generated when a new port type is added. Partner link types are used by BPEL processes.
    In a BPEL process, a partner link represents the interaction between the BPEL process and a partner service. Each partner link is associated with a partner link type.
    A partner link type characterizes the conversational relationship between two services. The partner link type can have one or two roles.-->
    <plnk:role name="BpelModulPortTypeRole" portType="tns:BpelModulPortType"/>
    </plnk:partnerLinkType>
    </definitions>


    but It appear this error :

    [WARNING] ignoring operation "BpelModulOperation": message part does not refer to a schema element declaration
    line 22 of file:/C:/NetBeansProjects/20080117/App/src/conf/xml-resources/web-service-references/BpelModul/wsdl/BpelModul.wsdl

    [WARNING] Port "BpelModulPort" does not contain any usable operations
    line 39 of file:/C:/NetBeansProjects/20080117/App/src/conf/xml-resources/web-service-references/BpelModul/wsdl/BpelModul.wsdl

    [WARNING] Service "BpelModul" does not contain any usable ports. try running wsimport with -extension switch.
    line 38 of file:/C:/NetBeansProjects/20080117/App/src/conf/xml-resources/web-service-references/BpelModul/wsdl/BpelModul.wsdl

    I need help, Thanks
  • 9. Re: Spot the error in the WSDL document
    843833 Newbie
    Currently Being Moderated
    Hi All, i did have the same problem, but i did can resolve parsing the WSDL whit Apache AXIS

    Hope can help you

    Regards
  • 10. Re: Spot the error in the WSDL document
    843833 Newbie
    Currently Being Moderated
    Hello everyone:

    ilargi, I have the same problem yours, it gives me when I want to create a Client Webservice a BPEL.

    Tried every means to find the problem but I bullet that if you send a simple BPEL objects this problem is solved, but when I want to create correlation of BPEL, this requires a XSD to declare the elements and able to create this correlation When I do this change is generated this error, the error echo begins with the creation of portType, which leaves them not create nor PRC PRC-literally, only encoded, but when I think customers also have problems.

    I have a serious problem with this, because without the correlation of BPEL, these fall at the time of any server, are lost and we can resume the workflow.

    If anyone had any idea or way of creating BPEL asynchronous with correlation and also able to create clients, would be extremely grateful, or at least someone had a tips about it. Revised and seen each of the Blueprint for Webservice, BPEL, clients and can not achieve cohecion such as the examples are very punctual.

    Romano: probe with Axis, but I have no good result.

    Any help will be eternally grateful
  • 11. Re: Spot the error in the WSDL document
    843833 Newbie
    Currently Being Moderated
    Thnaks, i resolve this error changing type="" for element="".