First you have to change the soap binding to rpc/lit or doc-lit, you can
do it manually, or use the cxf tool wsdltosoap
Then you can use the cxf tool wsdl2java to generate the
interface/service/client/server, then add your own impl class
But before you try your wsdl, you can take a look at the cxf samples,
start small hello_world demo, and see how it works in cxf.
BTW You have to use Java5
Cheers,
James.
Currently I have to create a service for a given wsdl to create an interface to
a thirdparty product. We could use an
existing Axis 1.4 implementation but I would prefer to use CXF instead.
I am new to WS development and currently I am not sure if this will work, as
the wsdl defines the service to be
"RPC/encoded" and RPC/encoded is not supported by JAXWS 2.0.
I attached the wsdl file, for which I have to implement the service, maybe you
can take a look and tell me, if it would
be a good idea, to try to use cxf and how I should start. The client, which
will use the service is not able to handle
multirefs and excepts the SomeBinary.content not to be embedded. Instead it should be
referenced to with href="cid..."
in an attachment.
Any help is welcome, as I do not want to use the old Axis 1.x classes....
Thanks,
Andreas
<?xml version="1.0" encoding="utf-8"?>
<definitions
targetNamespace="http://someurl.de/soap/somename"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soapwsdl="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://someurl.de/soap/somename"
xmlns:somexsd="http://someurl.de/soap/somename/Schema"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/">
<types>
<schema
xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://someurl.de/soap/somename/Schema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<complexType name="LoginResult">
<sequence>
<element name="message" type="xsd:string"
/>
<element name="sessionId"
type="xsd:string" />
<element name="resultCode" type="xsd:int"
/>
</sequence>
</complexType>
<complexType name="LogoutResult">
<sequence>
<element name="resultCode" type="xsd:int"
/>
</sequence>
</complexType>
<complexType name="SetLanguageResult">
<sequence>
<element name="message" type="xsd:string"
/>
<element name="resultCode" type="xsd:int"
/>
</sequence>
</complexType>
<complexType name="ArrayOfString">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType"
wsdl:arrayType="xsd:string[]" />
</restriction>
</complexContent>
</complexType>
<complexType name="CallResult">
<sequence>
<element name="result"
type="somexsd:ArrayOfString" />
<element name="resultCode" type="xsd:int"
/>
</sequence>
</complexType>
<complexType name="GetMessageResult">
<sequence>
<element name="message" type="xsd:string"
/>
<element name="resultCode" type="xsd:int"
/>
</sequence>
</complexType>
<complexType name="SomeCondition">
<sequence>
<element name="expr" type="xsd:string"
/>
<element name="op" type="xsd:string" />
<element name="value" type="xsd:string"
/>
</sequence>
</complexType>
<complexType name="ArrayOfSomeCondition">
<complexContent>
<restriction base="soapenc:Array">
<attribute
ref="soapenc:arrayType"
wsdl:arrayType="somexsd:SomeCondition[]" />
</restriction>
</complexContent>
</complexType>
<complexType name="SomeProduct">
<sequence>
<element name="id" type="xsd:int" />
<element name="id2" type="xsd:int" />
<element name="id3" type="xsd:int" />
<element name="imageId" type="xsd:int"
/>
<element name="classId" type="xsd:int"
/>
<element name="num" type="xsd:string" />
<element name="name" type="xsd:string"
/>
<element name="forceDelete"
type="xsd:boolean" />
<element name="panelStatementId"
type="xsd:int" />
<element name="docId" type="xsd:int" />
<element name="masterpage"
type="xsd:string" />
<element name="grid" type="xsd:string"
/>
<element name="gridelement"
type="xsd:string" />
<element name="gridId" type="xsd:int" />
<element name="gridelementId"
type="xsd:int" />
<element name="pageitemId" type="xsd:int"
/>
<element name="stringId" type="xsd:string"
/>
</sequence>
</complexType>
<complexType name="ArrayOfSomeProduct">
<complexContent>
<restriction base="soapenc:Array">
<attribute
ref="soapenc:arrayType"
wsdl:arrayType="somexsd:SomeProduct[]" />
</restriction>
</complexContent>
</complexType>
<complexType name="GetProductListResult">
<sequence>
<element name="productList"
type="somexsd:ArrayOfSomeProduct" />
<element name="resultCode" type="xsd:int"
/>
</sequence>
</complexType>
<complexType name="SomeBinary">
<sequence>
<element name="filename" type="xsd:string"
/>
<element name="mimetype" type="xsd:string"
/>
<element name="size" type="xsd:int" />
<element name="content" type="xsd:binary"
/>
</sequence>
</complexType>
<complexType name="GetBinaryFileResult">
<sequence>
<element name="file"
type="somexsd:SomeBinary" />
<element name="resultCode" type="xsd:int"
/>
</sequence>
</complexType>
<complexType name="PutBinaryFileResult">
<sequence>
<element name="resultCode" type="xsd:int"
/>
</sequence>
</complexType>
<complexType name="SomeElement">
<sequence>
<element name="id" type="xsd:int" />
<element name="id2" type="xsd:int" />
<element name="id3" type="xsd:int" />
<element name="classId" type="xsd:int"
/>
<element name="pageitemId" type="xsd:int"
/>
<element name="formatString"
type="xsd:string" />
</sequence>
</complexType>
<complexType name="ArrayOfSomeElement">
<complexContent>
<restriction base="soapenc:Array">
<attribute
ref="soapenc:arrayType"
wsdl:arrayType="somexsd:SomeElement[]" />
</restriction>
</complexContent>
</complexType>
<complexType name="GetElementListResult">
<sequence>
<element name="elementList"
type="somexsd:ArrayOfSomeElement" />
<element name="resultCode" type="xsd:int"
/>
</sequence>
</complexType>
<complexType name="ArrayOfArrayOfString">
<complexContent>
<restriction base="soapenc:Array">
<attribute
ref="soapenc:arrayType"
wsdl:arrayType="somexsd:ArrayOfString[]" />
</restriction>
</complexContent>
</complexType>
<complexType name="GetListResult">
<sequence>
<element name="list"
type="somexsd:ArrayOfArrayOfString" />
<element name="resultCode" type="xsd:int"
/>
</sequence>
</complexType>
<complexType name="AutoSomeJob">
<sequence>
<element name="id" type="xsd:int" />
<element name="name" type="xsd:string"
/>
<element name="command" type="xsd:string"
/>
<element name="commandId" type="xsd:int"
/>
<element name="objectId" type="xsd:int"
/>
<element name="objectPath"
type="xsd:string" />
<element name="templatePath"
type="xsd:string" />
<element name="priority" type="xsd:int"
/>
<element name="doAgain" type="xsd:boolean"
/>
<element name="delay" type="xsd:int" />
<element name="starttime"
type="xsd:dateTime" />
<element name="endtime"
type="xsd:dateTime" />
<element name="statusId" type="xsd:int"
/>
</sequence>
</complexType>
<complexType name="AutoSomeGetNextJobResult">
<sequence>
<element name="resultCode" type="xsd:int"
/>
<element name="job"
type="somexsd:AutoSomeJob" />
</sequence>
</complexType>
<complexType name="AutoSomeSetStartResult">
<sequence>
<element name="resultCode" type="xsd:int"
/>
</sequence>
</complexType>
<complexType name="AutoSomeSetStatusResult">
<sequence>
<element name="resultCode" type="xsd:int"
/>
</sequence>
</complexType>
<complexType name="AutoSomeSetDoneResult">
<sequence>
<element name="resultCode" type="xsd:int"
/>
</sequence>
</complexType>
<complexType name="AutoSomeHotfolder">
<sequence>
<element name="id" type="xsd:int" />
<element name="inFolder" type="xsd:string"
/>
<element name="outFolder"
type="xsd:string" />
<element name="errorFolder"
type="xsd:string" />
<element name="command" type="xsd:string"
/>
<element name="commandId" type="xsd:int"
/>
<element name="parameter"
type="xsd:string" />
</sequence>
</complexType>
<complexType name="AutoSomeGetNextHotfolderResult">
<sequence>
<element name="resultCode" type="xsd:int"
/>
<element name="hotfolder"
type="somexsd:AutoSomeHotfolder" />
</sequence>
</complexType>
</schema>
</types>
<message name="login">
<part name="login" type="xsd:string" />
<part name="passwd" type="xsd:string" />
<part name="client" type="xsd:string" />
<part name="language" type="xsd:string" />
</message>
<message name="loginResponse">
<part name="loginResult" type="somexsd:LoginResult" />
</message>
<message name="logout">
<part name="sessionId" type="xsd:string" />
</message>
<message name="logoutResponse">
<part name="logoutResult" type="somexsd:LogoutResult" />
</message>
<message name="setLanguage">
<part name="sessionId" type="xsd:string" />
<part name="language" type="xsd:string" />
</message>
<message name="setLanguageResponse">
<part name="setLanguageResult" type="somexsd:SetLanguageResult"
/>
</message>
<message name="call">
<part name="sessionId" type="xsd:string" />
<part name="method" type="xsd:string" />
<part name="arg" type="xsd:string" />
</message>
<message name="callResponse">
<part name="callResult" type="somexsd:CallResult" />
</message>
<message name="getMessage">
<part name="sessionId" type="xsd:string" />
<part name="resultCode" type="xsd:int" />
</message>
<message name="getMessageResponse">
<part name="getMessageResult" type="somexsd:GetMessageResult" />
</message>
<message name="getProductList">
<part name="sessionId" type="xsd:string" />
<part name="conditions" type="somexsd:ArrayOfSomeCondition" />
<part name="parentConditions" type="somexsd:ArrayOfSomeCondition"
/>
</message>
<message name="getProductListResponse">
<part name="getProductListResult"
type="somexsd:GetProductListResult" />
</message>
<message name="getBinaryFile">
<part name="sessionId" type="xsd:string" />
<part name="fileId" type="xsd:string" />
</message>
<message name="getBinaryFileResponse">
<part name="getBinaryFileResult"
type="somexsd:GetBinaryFileResult" />
</message>
<message name="putBinaryFile">
<part name="sessionId" type="xsd:string" />
<part name="fileId" type="xsd:string" />
<part name="file" type="somexsd:SomeBinary" />
</message>
<message name="putBinaryFileResponse">
<part name="putBinaryFileResult"
type="somexsd:PutBinaryFileResult" />
</message>
<message name="getElementList">
<part name="sessionId" type="xsd:string" />
<part name="method" type="xsd:string" />
<part name="arg" type="xsd:string" />
</message>
<message name="getElementListResponse">
<part name="getElementListResult"
type="somexsd:GetElementListResult" />
</message>
<message name="getList">
<part name="sessionId" type="xsd:string" />
<part name="method" type="xsd:string" />
<part name="arg" type="xsd:string" />
</message>
<message name="getListResponse">
<part name="getListResult" type="somexsd:GetListResult" />
</message>
<message name="autoSomeGetNextJob">
<part name="sessionId" type="xsd:string" />
<part name="program" type="xsd:string" />
<part name="client" type="xsd:string" />
<part name="status" type="xsd:int" />
</message>
<message name="autoSomeGetNextJobResponse">
<part name="autoSomeGetNextJobResult"
type="somexsd:AutoSomeGetNextJobResult" />
</message>
<message name="autoSomeSetStart">
<part name="sessionId" type="xsd:string" />
<part name="id" type="xsd:int" />
<part name="starttime" type="xsd:dateTime" />
<part name="status" type="xsd:int" />
<part name="client" type="xsd:string" />
</message>
<message name="autoSomeSetStartResponse">
<part name="autoSomeSetStartResult"
type="somexsd:AutoSomeSetStartResult" />
</message>
<message name="autoSomeSetStatus">
<part name="sessionId" type="xsd:string" />
<part name="id" type="xsd:int" />
<part name="status" type="xsd:int" />
</message>
<message name="autoSomeSetStatusResponse">
<part name="autoSomeSetStatusResult"
type="somexsd:AutoSomeSetStatusResult" />
</message>
<message name="autoSomeSetDone">
<part name="sessionId" type="xsd:string" />
<part name="id" type="xsd:int" />
<part name="status" type="xsd:int" />
<part name="starttime" type="xsd:dateTime" />
<part name="endtime" type="xsd:dateTime" />
<part name="exitValue" type="xsd:int" />
</message>
<message name="autoSomeSetDoneResponse">
<part name="autoSomeSetDoneResult"
type="somexsd:AutoSomeSetDoneResult" />
</message>
<message name="autoSomeGetNextHotfolder">
<part name="sessionId" type="xsd:string" />
<part name="program" type="xsd:string" />
<part name="client" type="xsd:string" />
<part name="status" type="xsd:int" />
<part name="id" type="xsd:int" />
</message>
<message name="autoSomeGetNextHotfolderResponse">
<part name="autoSomeGetNextHotfolderResult"
type="somexsd:AutoSomeGetNextHotfolderResult" />
</message>
<portType name="SomePort">
<operation name="login">
<documentation>Initialisieren einer
Sitzung</documentation>
<input message="tns:login" />
<output message="tns:loginResponse" />
</operation>
<operation name="logout">
<documentation>Beenden einer Sitzung</documentation>
<input message="tns:logout" />
<output message="tns:logoutResponse" />
</operation>
<operation name="setLanguage">
<documentation>Festlegen der Sprache</documentation>
<input message="tns:setLanguage" />
<output message="tns:setLanguageResponse" />
</operation>
<operation name="call">
<documentation>Benutzer / Anwendungsspezifische
Funktionen</documentation>
<input message="tns:call" />
<output message="tns:callResponse" />
</operation>
<operation name="getMessage">
<documentation>Fehlerbeschreibung des
Resultcodes</documentation>
<input message="tns:getMessage" />
<output message="tns:getMessageResponse" />
</operation>
<operation name="getProductList">
<documentation>Abruf der Produktliste</documentation>
<input message="tns:getProductList" />
<output message="tns:getProductListResponse" />
</operation>
<operation name="getBinaryFile">
<documentation>Anfordern einer Datei</documentation>
<input message="tns:getBinaryFile" />
<output message="tns:getBinaryFileResponse" />
</operation>
<operation name="putBinaryFile">
<documentation>Hochladen einer Datei</documentation>
<input message="tns:putBinaryFile" />
<output message="tns:putBinaryFileResponse" />
</operation>
<operation name="getElementList">
<documentation>Abruf der Elementliste für wiederholende
Elemente</documentation>
<input message="tns:getElementList" />
<output message="tns:getElementListResponse" />
</operation>
<operation name="getList">
<documentation>Allgemeine Liste</documentation>
<input message="tns:getList" />
<output message="tns:getListResponse" />
</operation>
<operation name="autoSomeGetNextJob">
<documentation>Liefert die nächste
Aufgabe</documentation>
<input message="tns:autoSomeGetNextJob" />
<output message="tns:autoSomeGetNextJobResponse" />
</operation>
<operation name="autoSomeSetStart">
<documentation>Meldet den Beginn der Ausführung einer
Aufgabe</documentation>
<input message="tns:autoSomeSetStart" />
<output message="tns:autoSomeSetStartResponse" />
</operation>
<operation name="autoSomeSetStatus">
<documentation>Ändert den Status einer
Aufgabe</documentation>
<input message="tns:autoSomeSetStatus" />
<output message="tns:autoSomeSetStatusResponse" />
</operation>
<operation name="autoSomeSetDone">
<documentation>Meldet das Ende der Ausführung einer
Aufgabe</documentation>
<input message="tns:autoSomeSetDone" />
<output message="tns:autoSomeSetDoneResponse" />
</operation>
<operation name="autoSomeGetNextHotfolder">
<documentation>Liefert den nächsten
Hotfolder</documentation>
<input message="tns:autoSomeGetNextHotfolder" />
<output message="tns:autoSomeGetNextHotfolderResponse"
/>
</operation>
</portType>
<binding name="Some" type="tns:SomePort">
<soapwsdl:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http/" />
<operation name="login">
<soapwsdl:operation soapAction="login" style="rpc" />
<input>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</input>
<output>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</output>
</operation>
<operation name="logout">
<soapwsdl:operation soapAction="logout" style="rpc" />
<input>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</input>
<output>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</output>
</operation>
<operation name="setLanguage">
<soapwsdl:operation soapAction="setLanguage" style="rpc"
/>
<input>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</input>
<output>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</output>
</operation>
<operation name="call">
<soapwsdl:operation soapAction="call" style="rpc" />
<input>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</input>
<output>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</output>
</operation>
<operation name="getMessage">
<soapwsdl:operation soapAction="getMessage" style="rpc"
/>
<input>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</input>
<output>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</output>
</operation>
<operation name="getProductList">
<soapwsdl:operation soapAction="getProductList"
style="rpc" />
<input>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</input>
<output>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</output>
</operation>
<operation name="getBinaryFile">
<soapwsdl:operation soapAction="getBinaryFile" style="rpc"
/>
<input>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</input>
<output>
<mime:multipartRelated>
<mime:part>
<soapwsdl:body
parts="getBinaryFileResult" use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</mime:part>
</mime:multipartRelated>
</output>
</operation>
<operation name="putBinaryFile">
<soapwsdl:operation soapAction="putBinaryFile" style="rpc"
/>
<input>
<mime:multipartRelated>
<mime:part>
<soapwsdl:body parts="sessionId fileId
file" use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</mime:part>
</mime:multipartRelated>
</input>
<output>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</output>
</operation>
<operation name="getElementList">
<soapwsdl:operation soapAction="getElementList"
style="rpc" />
<input>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</input>
<output>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</output>
</operation>
<operation name="getList">
<soapwsdl:operation soapAction="getList" style="rpc" />
<input>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</input>
<output>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</output>
</operation>
<operation name="autoSomeGetNextJob">
<soapwsdl:operation soapAction="autoSomeGetNextJob"
style="rpc" />
<input>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</input>
<output>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</output>
</operation>
<operation name="autoSomeSetStart">
<soapwsdl:operation soapAction="autoSomeSetStart"
style="rpc" />
<input>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</input>
<output>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</output>
</operation>
<operation name="autoSomeSetStatus">
<soapwsdl:operation soapAction="autoSomeSetStatus"
style="rpc" />
<input>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</input>
<output>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</output>
</operation>
<operation name="autoSomeSetDone">
<soapwsdl:operation soapAction="autoSomeSetDone"
style="rpc" />
<input>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</input>
<output>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</output>
</operation>
<operation name="autoSomeGetNextHotfolder">
<soapwsdl:operation soapAction="autoSomeGetNextHotfolder"
style="rpc" />
<input>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</input>
<output>
<soapwsdl:body use="encoded"
namespace="http://someurl.de/soap/somename"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</output>
</operation>
</binding>
<service name="SomeService">
<documentation></documentation>
<port binding="tns:Some" name="Some">
<soapwsdl:address
location="http://soapsdk.werk-ii.com/soap/?Some" />
</port>
</service>
</definitions>