Spot the error in the WSDL document

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 Bindingfor 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>

[7654 byte] By [markyhba] at [2007-10-2 21:05:18]
# 1
Hi!wsimport (in jaxws) gives this error: Invalid wsdl:operation "ReturnFile": its a document-literal operation, message part must refer to a schema element declarationYou could try to remove the -f:wsi option to see if the error persists..regards!/Ole
olemata at 2007-7-13 23:50:36 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

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

markyhba at 2007-7-13 23:50:36 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3

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

olemata at 2007-7-13 23:50:36 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4
Ole!,Thanks very much for your help, The changes you suggested worked!!WoohooRegardsmarkyhb
markyhba at 2007-7-13 23:50:36 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 5
glad I could help, good luck!/Oleeviware.com
olemata at 2007-7-13 23:50:36 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 6

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

sushil_ojhaa at 2007-7-13 23:50:36 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 7

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"/>

ARTFISHa at 2007-7-13 23:50:36 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...