I'm getting this message when attempting to create a new SoapUI project and import a WSDL for Web Service Simulation. The error message seems incomplete as it does not actually say what tag is not being closed.
Error loading [file:\C:\chad.wsdl]: org.apache.xmlbeans.XmlException: org.apache.xmlbeans.XmlException: error: does not close tag
Here's the WSDL:
<wsdl:definitions name="Chad" targetNamespace="http://www.examples.com/wsdl/Chad.wsdl" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.examples.com/wsdl/Chad.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:message name="SayHiRequest">
<wsdl:part name="text" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="SayHiResponse">
<wsdl:part name="text" type="xsd:string"/>
</wsdl:message>
<wsdl:portType name="Hello_PortType">
<wsdl:operation name="sayHi">
<wsdl:input message="tns:SayHiRequest"/>
<wsdl:output message="tns:SayHiResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="Hello_Binding" type="tns:Hello_PortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="sayHi">
<soap:operation soapAction="sayHi"/>
<wsdl:input>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:examples:chadservice" use="encoded"/>
</wsdl:input>
<wsdl:output>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:examples:chadservice" use="encoded"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Hello_Service">
<wsdl:documentation>WSDL File for HelloService</documentation>
<wsdl:port binding="tns:Hello_Binding" name="Hello_Port">
<soap:address location="http://www.examples.com/chad/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
My WSDL seems to validate.
I've found some similar issues online where the wsdl is imported from an http url and the import results in this same error, but i'm importing straight from my C drive (not over http) so the suggested solutions have not worked.
There was a namespace issue in the following line
Original line
<wsdl:documentation>WSDL File for HelloService</documentation>
Changed to
<wsdl:documentation>WSDL File for HelloService</wsdl:documentation>
Here is the updated wsdl
<?xml version='1.0' encoding="UTF-8"?>
<wsdl:definitions name="Chad" targetNamespace="http://www.examples.com/wsdl/Chad.wsdl" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.examples.com/wsdl/Chad.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:message name="SayHiRequest">
<wsdl:part name="text" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="SayHiResponse">
<wsdl:part name="text" type="xsd:string"/>
</wsdl:message>
<wsdl:portType name="Hello_PortType">
<wsdl:operation name="sayHi">
<wsdl:input message="tns:SayHiRequest"/>
<wsdl:output message="tns:SayHiResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="Hello_Binding" type="tns:Hello_PortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="sayHi">
<soap:operation soapAction="sayHi"/>
<wsdl:input>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:examples:chadservice" use="encoded"/>
</wsdl:input>
<wsdl:output>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:examples:chadservice" use="encoded"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Hello_Service">
<wsdl:documentation>WSDL File for HelloService</wsdl:documentation>
<wsdl:port binding="tns:Hello_Binding" name="Hello_Port">
<soap:address location="http://www.examples.com/chad/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I was able to load the WSDL in soapUI 4.5.2 without getting the error you got. Although, I did get the below error.
Tue Aug 20 11:30:21 ADT 2013:ERROR:Could not find element [{https://something.com/service/types}IsAvailableRequest] specified in part [parameters]
I had the same error but a different cause:
Instead of:
https://sitename.com/prefix/app/services.asxm
Use:
https://sitename.com/prefix/app/services.asxm?WSDL
I hadn't used SOAP before and it wasn't immediately obvious that I was missing the ?WSDL from the url. Posting just in case anyone else has the same issue.
Related
I am invoking a business service from OSB 12C that accepts POST methods. I added a REST adapter in the business column after making the request and response XSD's. In the pipeline, I use an XQuery file for transformation of the proxy service's request body to the business service's body.
Examining the receiving app as well as the network traffic, I see that the request is being submitted with a Content-Type: application/x-www-form-urlencoded header, but the payload is completely blank.
As a test, I changed the method to GET. This places the form fields within the URL, so the transformation, etc. is correct. It just doesn't work in the POST method. I've been stuck for a week on this.
Here's the XSD for the business request:
<?xml version = '1.0' encoding = 'UTF-8'?>
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
xmlns:tns="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_request"
targetNamespace="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_request"
elementFormDefault="qualified" attributeFormDefault="unqualified" nxsd:encoding="US-ASCII">
<xsd:element name="GetPendingRequests-BusinessRequest-Root-Element">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="db" type="xsd:string"/>
<xsd:element name="fromDate" type="xsd:string"/>
<xsd:element name="max" type="xsd:integer"/>
<xsd:element name="page" type="xsd:integer"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:annotation>
<xsd:appinfo>NXSDSAMPLE=</xsd:appinfo>
<xsd:appinfo>USEHEADER=false</xsd:appinfo>
</xsd:annotation>
</xsd:schema>
And the XQuery file:
xquery version "1.0" encoding "utf-8";
(:: OracleAnnotationVersion "1.0" ::)
declare namespace smar="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_request";
(:: import schema at "GetPendingRequestsBusinessRequest.xsd" ::)
declare variable $db as xs:string external;
declare variable $fromDate as xs:string external;
declare variable $max as xs:integer external;
declare variable $page as xs:integer external;
declare function local:func($db as xs:string, $fromDate as xs:string, $max as xs:integer, $page as xs:integer) as element()
(:: schema-element(smar:GetPendingRequests-BusinessRequest-Root-Element) ::) {
<smar:GetPendingRequests-BusinessRequest-Root-Element
xmlns:smar="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_request">
<smar:db>{fn:data($db)}</smar:db>
<smar:fromDate>{fn:data($fromDate)}</smar:fromDate>
<smar:max>{fn:data($max)}</smar:max>
<smar:page>{fn:data($page)}</smar:page>
</smar:GetPendingRequests-BusinessRequest-Root-Element>
};
local:func($db, $fromDate, $max, $page)
The WADL file:
<?xml version = '1.0' encoding = 'UTF-8'?>
<application xmlns:soa="http://www.oracle.com/soa/rest"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tns="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_request"
xmlns="http://wadl.dev.java.net/2009/02">
<doc title="SmartCardBusinessServices">WADL Reference for REST calls for smart cards</doc>
<grammars>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_request"
schemaLocation="../../GetPendingRequests/Business/GetPendingRequestsBusinessRequest.xsd"/>
</xsd:schema>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_response"
schemaLocation="../../GetPendingRequests/Business/GetPendingRequestsBusinessResponse.xsd"/>
</xsd:schema>
</grammars>
<resources>
<resource path="/getPendingRequests">
<method name="POST" soa:wsdlOperation="GetPendingRequests">
<request>
<representation mediaType="application/x-www-form-urlencoded"
element="cns:GetPendingRequests-BusinessRequest-Root-Element"
xmlns:cns="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_request"/>
</request>
<response status="200">
<representation mediaType="application/json"
element="cns:GetPendingRequests-BusinessResponse-Root-Element"
xmlns:cns="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_response"/>
</response>
</method>
</resource>
</resources>
</application>
Lastly, the WSDL:
<?xml version= '1.0' encoding= 'UTF-8' ?>
<wsdl:definitions
name="SmartCardBusinessServices"
targetNamespace="http://xmlns.oracle.com/ServiceBusApplication1/MVRServices/SmartCardBusinessServices"
xmlns:tns="http://xmlns.oracle.com/ServiceBusApplication1/MVRServices/SmartCardBusinessServices"
xmlns:inp1="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_request"
xmlns:inp2="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_response"
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>
<plnk:partnerLinkType name="SmartCardBusinessServices">
<plnk:role name="SmartCardBusinessServicesProvider" portType="tns:SmartCardBusinessServices_ptt"/>
</plnk:partnerLinkType>
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_request"
schemaLocation="../../GetPendingRequests/Business/GetPendingRequestsBusinessRequest.xsd"/>
</xsd:schema>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://TargetNamespace.com/SmartCardBusiness_GetPendingRequests_response"
schemaLocation="../../GetPendingRequests/Business/GetPendingRequestsBusinessResponse.xsd"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="GetPendingRequests_inputMessage">
<wsdl:part name="request" element="inp1:GetPendingRequests-BusinessRequest-Root-Element"/>
</wsdl:message>
<wsdl:message name="GetPendingRequests_outputMessage">
<wsdl:part name="reply" element="inp2:GetPendingRequests-BusinessResponse-Root-Element"/>
</wsdl:message>
<wsdl:portType name="SmartCardBusinessServices_ptt">
<wsdl:operation name="GetPendingRequests">
<wsdl:input message="tns:GetPendingRequests_inputMessage"/>
<wsdl:output message="tns:GetPendingRequests_outputMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="SmartCardBusinessServices_ptt-binding" type="tns:SmartCardBusinessServices_ptt">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetPendingRequests">
<soap:operation soapAction="GetPendingRequests"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
</wsdl:definitions>
In my example of soap mtom optimization I've realized an project on Tomcat 7, metro (glassfish) in which I've got:
XSD
<xs:element name="retrievePicture" type="tns:retrievePicture"/>
<xs:complexType name="retrievePicture">
<xs:sequence>
<xs:element name="inImageNumber" type="xs:int"/>
</xs:sequence>
</xs:complexType>
<xs:element name="retrievePictureResponse" type="tns:JPEGPictureType"/>
<xs:simpleType name="JPEGPictureType"
xmime:expectedContentTypes="image/jpeg">
<xs:restriction base="xs:base64Binary" />
</xs:simpleType>
WSDL
<definitions ... >
<wsp:Policy
wsu:Id="PictureManagerPortBinding_MTOM_Policy-PictureManagerPortBinding_MTOM_Policy">
<ns1:OptimizedMimeSerialization
xmlns:ns1="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization"
wsp:Optional="true" />
</wsp:Policy>
<types>
<xsd:schema>
<xsd:import namespace="http://service.ivan.com/" schemaLocation="PictureManagerService_schema1.xsd"/>
</xsd:schema>
</types>
<message name="retrievePicture">
<part name="parameters" element="tns:retrievePicture" />
</message>
<message name="retrievePictureResponse">
<part name="parameters" element="tns:retrievePictureResponse" />
</message>
<portType name="PictureManager">
<operation name="retrievePicture">
<input
wsam:Action="http://service.ivan.com/PictureManager/retrievePictureRequest"
message="tns:retrievePicture" />
<output
wsam:Action="http://service.ivan.com/PictureManager/retrievePictureResponse"
message="tns:retrievePictureResponse" />
</operation>
</portType>
<binding name="PictureManagerPortBinding" type="tns:PictureManager">
<wsp:PolicyReference
URI="#PictureManagerPortBinding_MTOM_Policy-PictureManagerPortBinding_MTOM_Policy" />
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
<operation name="retrievePicture">
...
</operation>
</binding>
<service name="PictureManagerService">
...
</service>
</definitions>
SEI
#WebService(wsdlLocation="WEB-INF/wsdl/PictureManagerService.wsdl")
#MTOM
public class PictureManager {
....
#WebMethod(operationName = "retrievePicture")
public Image retrievePicture(
#WebParam(name = "inImageNumber") final int inImageNumber) {
java.awt.Image theImage = null;
//logic for return Image according request
return theImage;
}
}
My project consist of download JPEG image according of request.
In Soapui I get the following raw response:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: multipart/related; start="<rootpart*c069e1e8-2a0a-4ef7-8270-19bda938c27d#example.jaxws.sun.com>"; type="application/xop+xml"; boundary="uuid:c069e1e8-2a0a-4ef7-8270-19bda938c27d"; start-info="text/xml"
Transfer-Encoding: chunked
Date: Wed, 03 Jun 2015 08:03:55 GMT
--uuid:c069e1e8-2a0a-4ef7-8270-19bda938c27d
Content-Id: <rootpart*c069e1e8-2a0a-4ef7-8270-19bda938c27d#example.jaxws.sun.com>
Content-Type: application/xop+xml;charset=UTF-8;type="text/xml"
Content-Transfer-Encoding: binary
<?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:retrievePictureResponse xmlns:ns2="http://service.ivan.com/"><return><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:deba19db-0a7f-4367-82c3-b466e22f31fd#example.jaxws.sun.com"/></return></ns2:retrievePictureResponse></S:Body></S:Envelope>
--uuid:c069e1e8-2a0a-4ef7-8270-19bda938c27d
Content-Id: <deba19db-0a7f-4367-82c3-b466e22f31fd#example.jaxws.sun.com>
Content-Type: image/png
Content-Transfer-Encoding: binary
The problem is that the content type "image/png" is wrong as I would have expected "image/jpeg"
As i just had a similar issue, I don't think that this snippet will generate a DataHandler:
<xs:simpleType name="JPEGPictureType"
xmime:expectedContentTypes="image/jpeg">
<xs:restriction base="xs:base64Binary" />
</xs:simpleType>
I'am still trying to find out why, but meanwhile you can do the same as me and I think that will help you too. Just use directly the element retrievePictureResponse instead of working with xs:simpleType, so you can use this code :
<xs:element name="retrievePictureResponse" type="xs:base64Binary"
xmime:expectedContentTypes="image/jpeg" />
I was wondering if is there some way to convert an old RPC WSDL file to a JAX-WS WSDL file. Tried my best to make sure I did my homework but I'm kind of lost here.
From what I've read, I should remove all the 'encodingstyle' ocurrences and switch use="encoded" to use="literal". I can't run any tests by now since the service is currently unavailable. Does anyone know if that should be enough? Any insight will be extremely appreciated.
This is my WSDL file:
<?xml version="1.0" encoding="iso-8859-1"?>
<definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:wsScrc.XML" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:wsScrc.XML">
<types>
<xsd:schema targetNamespace="urn:wsScrc.XML">
<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
<xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
</xsd:schema>
</types>
<message name="XMLRequest">
<part name="parmA" type="xsd:string" />
<part name="parmB" type="xsd:string" />
<part name="parmC" type="xsd:string" />
<part name="parmD" type="xsd:string" />
<part name="parmE" type="xsd:string" />
<part name="parmF" type="xsd:string" />
<part name="parmG" type="xsd:string" />
</message>
<message name="XMLResponse">
<part name="respA" type="xsd:string" />
<part name="respB" type="xsd:string" />
<part name="respC" type="xsd:string" />
<part name="respD" type="xsd:string" />
<part name="respE" type="xsd:string" />
</message>
<message name="monitorRequest"></message>
<message name="monitorResponse">
<part name="ipServidor" type="xsd:string" />
</message>
<portType name="wsScrc.XMLPortType">
<operation name="XML">
<documentation>Retorna o xml</documentation>
<input message="tns:XMLRequest"/>
<output message="tns:XMLResponse"/>
</operation>
<operation name="monitor">
<documentation>Retorna uma mensagem de ok</documentation>
<input message="tns:monitorRequest"/>
<output message="tns:monitorResponse"/>
</operation>
</portType>
<binding name="wsScrc.XMLBinding" type="tns:wsScrc.XMLPortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="XML">
<soap:operation soapAction="urn:wsScrc.XML#XML" style="rpc"/>
<input>
<soap:body use="encoded" namespace="urn:wsScrc.XML" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="urn:wsScrc.XML" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="monitor">
<soap:operation soapAction="urn:wsScrc.monitor#monitor" style="rpc"/>
<input>
<soap:body use="encoded" namespace="urn:wsScrc.monitor" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="urn:wsScrc.monitor" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name="wsScrc.XML">
<port name="wsScrc.XMLPort" binding="tns:wsScrc.XMLBinding">
<soap:address location="http://thisismyaddress/webservicePHP/ws.php"/>
</port>
</service>
</definitions>
Thanks in advance.
We were able to do the same by altering the WSDL in that way.
The only issue is that we had to use SAAJ in order to generate the right request and to process the response.
In another WS we used it was just not possible because the XML in the body is generated by Castor. Finally we did not succeed as we did not know what the server expect.
In conclusion I would say: it depends how the server was implemented.
I'm using this wsdl-file to describe my webservice:
<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions targetNamespace="http://www.myapproach.de/knowledgebase" name="Knowledgebase"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:tns="http://www.myapproach.de/knowledgebase"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:rq="http://www.myapproach.de/knowledgebase">
<wsdl:types>
<xsd:schema>
<xsd:import namespace="http://www.myapproach.de/knowledgebase" schemaLocation="GetValueRequest.xsd"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="getValueForKey">
<wsdl:part name="parameters" element="rq:getValueForKey" />
</wsdl:message>
<wsdl:message name="getValueForKeyResponse">
<wsdl:part name="parameters" element="rq:getValueForKeyResponse" />
</wsdl:message>
<wsdl:portType name="KnowledgebasePortType">
<wsdl:operation name="getValueForKey">
<wsdl:input message="tns:getValueForKey" />
<wsdl:output message="tns:getValueForKeyResponse" />
</wsdl:operation>
</wsdl:portType>
<wsp:Policy wsu:Id="KnowledgebasePortBinding_WSAM_Addressing_Policy">
<wsam:Addressing wsp:Optional="true">
<wsp:Policy />
</wsam:Addressing>
</wsp:Policy>
<wsdl:binding name="KnowledgebasePortBinding" type="tns:KnowledgebasePortType">
<wsaw:UsingAddressing />
<wsp:PolicyReference URI="#KnowledgebasePortBinding_WSAM_Addressing_Policy" />
<!-- http://www.w3.org/2003/05/soap/bindings/HTTP/ -->
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" />
<wsdl:operation name="getValueForKey">
<soap:operation soapAction="http://www.myapproach.de/knowledgebase/getValueForKey" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Knowledgebase">
<wsdl:port name="KnowledgebasePortType" binding="tns:KnowledgebasePortBinding">
<soap:address location="http://www.myapproach.de/knowledgebase" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
GetValueRequest.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.myapproach.de/knowledgebase" xmlns:tns="http://www.myapproach.de/knowledgebase">
<xsd:element name="getValueForKey" type="tns:getValueForKey" />
<xsd:complexType name="getValueForKey">
<xsd:sequence>
<xsd:element name="arg0" type="xsd:string" minOccurs="0" />
<xsd:element name="arg1" type="xsd:string" minOccurs="0" />
<xsd:element name="arg2" type="xsd:double"></xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="getValueForKeyResponse" type="tns:getValueForKeyResponse" />
<xsd:complexType name="getValueForKeyResponse">
<xsd:sequence>
<xsd:element name="return" type="xsd:string" minOccurs="0" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
Everytime I run wsimport, I get this error:
[wsimport] parsing WSDL...
[wsimport] [ERROR] Invalid wsdl:operation "getValueForKey": its a rpc-literal operation, message part must refer to a schema type declaration
[wsimport] line 27 of file:/path/MyFile.wsdl
I have exported the getValueForKey type to the xsd-schemafile, so I don't understand this error... I'm trying this sh*** the whole day grml
Shortly after posting the question I found the answer :-)
Instead of
<wsdl:message name="getValueForKey">
<wsdl:part name="parameters" element="rq:getValueForKey" />
</wsdl:message>
use this
<wsdl:message name="getValueForKey">
<wsdl:part name="parameters" type="rq:getValueForKey" />
</wsdl:message>
the attribute "type" must be used instead of "element".
Additionally the soap:body element has to have a namespace
<wsdl:input>
<soap:body use="literal" namespace="YourNormalNamespace" />
</wsdl:input>
In short, wsdl part has to have type in case of RPC style of webservices else it has to be document style.
can i specify 2 locations for a single portType operation in the service tag ? Basically this means that the client would call say url1 if it supports soap binding and url2 for some other bindings.
<wsdl:service name="NewService">
<wsdl:port name="NewPort" binding="tns:NewBinding">
<soap:address location="http://url1"/>
</wsdl:port>
<wsdl:port name="NewPort" binding="tns:NewBinding2">
<soap12:address location="http://url2"/>
</wsdl:port>
</wsdl:service>
can't i do something like this ? where you can access NewPort operation through either url1 or url2.
Yes, you can do something like this:
<wsdl:service name="NewService">
<wsdl:port name="NewPort" binding="tns:NewBinding">
<soap:address location="http://url1"/>
</wsdl:port>
<wsdl:port name="NewPort2" binding="tns:NewBinding2">
<soap12:address location="http://url2"/>
</wsdl:port>
</wsdl:service>
Both bindings can refer to the same portType.
Full WSDL:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns="http://new.webservice.namespace" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
targetNamespace="http://new.webservice.namespace">
<wsdl:types>
<xs:schema targetNamespace="http://new.webservice.namespace" elementFormDefault="qualified"/>
</wsdl:types>
<wsdl:message name="NewMessageRequest">
<wsdl:part name="parameter" type="xs:string"/>
</wsdl:message>
<wsdl:message name="NewMessageResponse">
<wsdl:part name="parameter" type="xs:string"/>
</wsdl:message>
<wsdl:portType name="NewPortType">
<wsdl:operation name="NewOperation">
<wsdl:input message="tns:NewMessageRequest"/>
<wsdl:output message="tns:NewMessageResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="NewBinding" type="tns:NewPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="NewOperation">
<soap:operation soapAction="urn:#NewOperation"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="NewBinding2" type="tns:NewPortType">
<soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="NewOperation">
<soap12:operation soapAction="urn:#NewOperation" soapActionRequired="true" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="NewService">
<wsdl:port name="NewPort" binding="tns:NewBinding">
<soap:address location="http://url1"/>
</wsdl:port>
<wsdl:port name="NewPort2" binding="tns:NewBinding2">
<soap12:address location="http://url2"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>