I am new to WSDL and trying to validate the WSDL. I have to generate code from WSDL. I get the following error
The operation specified for the 'DictionaryServiceServiceSoapBinding'
binding is not defined for port type 'DictionaryService'. All
operations specified in this binding must be defined in port type
'DictionaryService'.
Following is my WSDL:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="DictionaryService" targetNamespace="http://dictionaryservice.example.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://dictionaryservice.example.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://dictionaryservice.example.com/" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://dictionaryservice.example.com/">
<xs:element name="addDataToDict" type="tns:addDataToDict"/>
<xs:element name="addDataToDictResponse" type="tns:addDataToDictResponse"/>
<xs:complexType name="addDataToDict">
<xs:sequence>
<xs:element name="identifier" type="xs:string"/>
<xs:element name="description" type="xs:string"/>
<xs:element name="uri" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="addDataToDictResponse">
<xs:sequence>
<xs:element name="status" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
<xs:element name="listOfAllIndexes" type="tns:listOfAllIndexes"/>
<xs:element name="listOfAllIndexesResponse" type="tns:listOfAllIndexesResponse"/>
<xs:complexType name="listOfAllIndexes">
<xs:sequence>
</xs:sequence>
</xs:complexType>
<xs:complexType name="listOfAllIndexesResponse">
<xs:sequence>
<xs:element name="list" type="tns:listData"/>
</xs:sequence>
</xs:complexType>
<xs:element name="getDictByIndex" type="tns:getDictByIndex"/>
<xs:element name="getDictByIndexResponse" type="tns:getDictByIndexResponse"/>
<xs:complexType name="getDictByIndex">
<xs:sequence>
<xs:element name="index" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="getDictByIndexResponse">
<xs:sequence>
<xs:element name="data" type="tns:dictData"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="listData">
<xs:sequence>
<xs:element name="identifier" type="xs:integer"/>
<xs:element name="index" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="dictData">
<xs:sequence>
<xs:element name="identifier" type="xs:string"/>
<xs:element name="description" type="xs:string"/>
<xs:element name="uri" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="addDataToDict">
<wsdl:part name="NewPart" type="tns:addDataToDict"></wsdl:part>
</wsdl:message>
<wsdl:message name="addDataToDictResponse">
<wsdl:part name="NewPart" type="tns:addDataToDictResponse"></wsdl:part>
</wsdl:message>
<wsdl:message name="listOfAllIndexes">
<wsdl:part name="NewPart" type="tns:listOfAllIndexes"></wsdl:part>
</wsdl:message>
<wsdl:message name="listOfAllIndexesResponse">
<wsdl:part name="NewPart" type="tns:listOfAllIndexesResponse"></wsdl:part>
</wsdl:message>
<wsdl:message name="getDictByIndex">
<wsdl:part name="NewPart" type="tns:getDictByIndex"></wsdl:part>
</wsdl:message>
<wsdl:message name="getDictByIndexResponse">
<wsdl:part name="NewPart" type="tns:getDictByIndexResponse"></wsdl:part>
</wsdl:message>
<wsdl:portType name="DictionaryService">
<wsdl:operation name="addDataToDict">
<wsdl:input message="tns:addDataToDict"></wsdl:input>
<wsdl:output message="tns:addDataToDictResponse"></wsdl:output>
</wsdl:operation>
<wsdl:operation name="listOfAllIndexes">
<wsdl:input message="tns:listOfAllIndexes"></wsdl:input>
<wsdl:output message="tns:listOfAllIndexesResponse"></wsdl:output>
</wsdl:operation>
<wsdl:operation name="getDictByIndex">
<wsdl:input message="tns:getDictByIndex"></wsdl:input>
<wsdl:output message="tns:getDictByIndexResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="DictionaryServiceServiceSoapBinding" type="tns:DictionaryService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="addDataToDict">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="addDataToDict">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="addDataToDictResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="listOfAllIndexes">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="listOfAllIndexes">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="listOfAllIndexesResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getDictByIndex">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="getDictByIndex">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getDictByIndexResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="DictionaryService">
<wsdl:port name="DictionaryServicePort" binding="tns:DictionaryServiceServiceSoapBinding">
<soap:address location="http://localhost:9090/DictionaryServicePort"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I tried myself but couldn't find the answer.
Try giving different names for each message/part <wsdl:part name="NewPart" .....> like
<wsdl:message name="addDataToDict">
<wsdl:part name="AddDataToDictRequestPart" type="tns:addDataToDict"></wsdl:part>
</wsdl:message>
<wsdl:message name="addDataToDictResponse">
<wsdl:part name="addDataToDictResponsePart" type="tns:addDataToDictResponse"></wsdl:part>
</wsdl:message>
Related
I have implemented SAAJ API of Java to create a SOAP request message and send it to the Endpoint URL. But I'm receiving following error while sending the SOAP message:
javax.xml.soap.SOAPException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'd' (code 100) after '<!' (malformed comment?) at [row,col {unknown-source}]: [1,3] at org.apache.axis2.saaj.SOAPConnectionImpl.call(SOAPConnectionImpl.java :209)
The SOAP message that i send is :
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<addMembers xmlns="http://spotfire.tibco.com/ws/pub/2013/03/userdir.xsd">
<groupName xmlns="">
<name>FI Index</name>
<domainName>SPOTFIRE</domainName>
</groupName>
<memberNames xmlns:q1="http://spotfire.tibco.com/ws/pub/2013/03/userdir.xsd" xmlns="" xsi:type="q1:UserName">
<name>UserID</name>
<domainName>SPOTFIRE</domainName>
</memberNames>
</addMembers>
</soapenv:Body>
</soapenv:Envelope>
Could you please suggest me what could be causing the error ? Also below is the WSDL file of the target application:
<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://spotfire.tibco.com/ws/pub/2013/03/userdir.xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns2="http://schemas.xmlsoap.org/soap/http" xmlns:ns1="http://spotfire.tibco.com/ws/pub/2013/03/faults.xsd" name="UserDirectoryService" targetNamespace="http://spotfire.tibco.com/ws/pub/2013/03/userdir.xsd">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://spotfire.tibco.com/ws/pub/2013/03/userdir.xsd" xmlns:ns1="http://spotfire.tibco.com/ws/pub/2013/03/common.xsd" elementFormDefault="unqualified" targetNamespace="http://spotfire.tibco.com/ws/pub/2013/03/userdir.xsd" version="1.0">
<xs:import namespace="http://spotfire.tibco.com/ws/pub/2013/03/common.xsd"/>
<xs:element name="addMembers" type="tns:addMembers"/>
<xs:element name="addMembersResponse" type="tns:addMembersResponse"/>
<xs:element name="createGroup" type="tns:createGroup"/>
<xs:element name="createGroupResponse" type="tns:createGroupResponse"/>
<xs:element name="createUser" type="tns:createUser"/>
<xs:element name="createUserResponse" type="tns:createUserResponse"/>
<xs:element name="getAllGroups" type="tns:getAllGroups"/>
<xs:element name="getAllGroupsResponse" type="tns:getAllGroupsResponse"/>
<xs:element name="getGroupById" type="tns:getGroupById"/>
<xs:element name="getGroupByIdResponse" type="tns:getGroupByIdResponse"/>
<xs:element name="getGroupByName" type="tns:getGroupByName"/>
<xs:element name="getGroupByNameResponse" type="tns:getGroupByNameResponse"/>
<xs:element name="getImmediateGroups" type="tns:getImmediateGroups"/>
<xs:element name="getImmediateGroupsResponse" type="tns:getImmediateGroupsResponse"/>
<xs:element name="getMembers" type="tns:getMembers"/>
<xs:element name="getMembersResponse" type="tns:getMembersResponse"/>
<xs:element name="getUserById" type="tns:getUserById"/>
<xs:element name="getUserByIdResponse" type="tns:getUserByIdResponse"/>
<xs:element name="getUserByName" type="tns:getUserByName"/>
<xs:element name="getUserByNameResponse" type="tns:getUserByNameResponse"/>
<xs:element name="isMember" type="tns:isMember"/>
<xs:element name="isMemberResponse" type="tns:isMemberResponse"/>
<xs:element name="removeMembers" type="tns:removeMembers"/>
<xs:element name="removeMembersResponse" type="tns:removeMembersResponse"/>
<xs:element name="removePrincipals" type="tns:removePrincipals"/>
<xs:element name="removePrincipalsResponse" type="tns:removePrincipalsResponse"/>
<xs:element name="searchGroups" type="tns:searchGroups"/>
<xs:element name="searchGroupsResponse" type="tns:searchGroupsResponse"/>
<xs:element name="searchUsers" type="tns:searchUsers"/>
<xs:element name="searchUsersResponse" type="tns:searchUsersResponse"/>
<xs:element name="setDisplayName" type="tns:setDisplayName"/>
<xs:element name="setDisplayNameResponse" type="tns:setDisplayNameResponse"/>
<xs:element name="setEmail" type="tns:setEmail"/>
<xs:element name="setEmailResponse" type="tns:setEmailResponse"/>
<xs:element name="setMembers" type="tns:setMembers"/>
<xs:element name="setMembersResponse" type="tns:setMembersResponse"/>
<xs:element name="setName" type="tns:setName"/>
<xs:element name="setNameResponse" type="tns:setNameResponse"/>
<xs:element name="setPassword" type="tns:setPassword"/>
<xs:element name="setPasswordResponse" type="tns:setPasswordResponse"/>
<xs:element name="setUserEnabled" type="tns:setUserEnabled"/>
<xs:element name="setUserEnabledResponse" type="tns:setUserEnabledResponse"/>
<xs:complexType name="getImmediateGroups">
<xs:sequence>
<xs:element minOccurs="0" name="principalName" type="tns:PrincipalName"/>
</xs:sequence>
</xs:complexType>
<xs:complexType abstract="true" name="PrincipalName">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element minOccurs="0" name="domainName" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType final="extension restriction" name="UserName">
<xs:complexContent>
<xs:extension base="tns:PrincipalName">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType final="extension restriction" name="GroupName">
<xs:complexContent>
<xs:extension base="tns:PrincipalName">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="getImmediateGroupsResponse">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="return" type="tns:GroupPrincipal"/>
</xs:sequence>
</xs:complexType>
<xs:complexType final="extension restriction" name="GroupPrincipal">
<xs:complexContent>
<xs:extension base="tns:SpotfirePrincipal">
<xs:sequence>
<xs:element name="immutable" type="xs:boolean"/>
<xs:element name="fixed" type="xs:boolean"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType abstract="true" name="SpotfirePrincipal">
<xs:sequence>
<xs:element name="id" type="ns1:GUID"/>
<xs:element name="principalName" type="tns:PrincipalName"/>
<xs:element name="displayName" type="xs:string"/>
<xs:element minOccurs="0" name="email" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType final="extension restriction" name="UserPrincipal">
<xs:complexContent>
<xs:extension base="tns:SpotfirePrincipal">
<xs:sequence>
<xs:element name="enabled" type="xs:boolean"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="getMembers">
<xs:sequence>
<xs:element minOccurs="0" name="groupName" type="tns:GroupName"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="getMembersResponse">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="return" type="tns:SpotfirePrincipal"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="getUserByName">
<xs:sequence>
<xs:element minOccurs="0" name="userName" type="tns:UserName"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="getUserByNameResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="tns:UserPrincipal"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="setUserEnabled">
<xs:sequence>
<xs:element minOccurs="0" name="userName" type="tns:UserName"/>
<xs:element name="enabled" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="setUserEnabledResponse">
<xs:sequence/>
</xs:complexType>
<xs:complexType name="createUser">
<xs:sequence>
<xs:element minOccurs="0" name="username" type="xs:string"/>
<xs:element minOccurs="0" name="domainName" type="xs:string"/>
<xs:element minOccurs="0" name="displayName" type="xs:string"/>
<xs:element minOccurs="0" name="email" type="xs:string"/>
<xs:element minOccurs="0" name="password" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="createUserResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="tns:UserPrincipal"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="setMembers">
<xs:sequence>
<xs:element minOccurs="0" name="groupName" type="tns:GroupName"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="memberNames" type="tns:PrincipalName"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="setMembersResponse">
<xs:sequence/>
</xs:complexType>
<xs:complexType name="getGroupById">
<xs:sequence>
<xs:element minOccurs="0" name="id" type="ns1:GUID"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="getGroupByIdResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="tns:GroupPrincipal"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="addMembers">
<xs:sequence>
<xs:element minOccurs="0" name="groupName" type="tns:GroupName"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="memberNames" type="tns:PrincipalName"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="addMembersResponse">
<xs:sequence/>
</xs:complexType>
<xs:complexType name="setEmail">
<xs:sequence>
<xs:element minOccurs="0" name="principalName" type="tns:PrincipalName"/>
<xs:element minOccurs="0" name="email" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="setEmailResponse">
<xs:sequence/>
</xs:complexType>
<xs:complexType name="setDisplayName">
<xs:sequence>
<xs:element minOccurs="0" name="principalName" type="tns:PrincipalName"/>
<xs:element minOccurs="0" name="displayName" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="setDisplayNameResponse">
<xs:sequence/>
</xs:complexType>
<xs:complexType name="searchUsers">
<xs:sequence>
<xs:element minOccurs="0" name="searchExpression" type="xs:string"/>
<xs:element name="maxResults" type="xs:int"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="searchUsersResponse">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="return" type="tns:UserPrincipal"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="searchGroups">
<xs:sequence>
<xs:element minOccurs="0" name="searchExpression" type="xs:string"/>
<xs:element name="maxResults" type="xs:int"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="searchGroupsResponse">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="return" type="tns:GroupPrincipal"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="isMember">
<xs:sequence>
<xs:element minOccurs="0" name="groupName" type="tns:GroupName"/>
<xs:element minOccurs="0" name="principalName" type="tns:PrincipalName"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="isMemberResponse">
<xs:sequence>
<xs:element name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="removePrincipals">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="principalNames" type="tns:PrincipalName"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="removePrincipalsResponse">
<xs:sequence/>
</xs:complexType>
<xs:complexType name="removeMembers">
<xs:sequence>
<xs:element minOccurs="0" name="groupName" type="tns:GroupName"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="memberNames" type="tns:PrincipalName"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="removeMembersResponse">
<xs:sequence/>
</xs:complexType>
<xs:complexType name="getGroupByName">
<xs:sequence>
<xs:element minOccurs="0" name="groupName" type="tns:GroupName"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="getGroupByNameResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="tns:GroupPrincipal"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="setName">
<xs:sequence>
<xs:element minOccurs="0" name="principalName" type="tns:PrincipalName"/>
<xs:element minOccurs="0" name="name" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="setNameResponse">
<xs:sequence/>
</xs:complexType>
<xs:complexType name="getAllGroups">
<xs:sequence>
<xs:element minOccurs="0" name="principalName" type="tns:PrincipalName"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="getAllGroupsResponse">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="return" type="tns:GroupPrincipal"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="setPassword">
<xs:sequence>
<xs:element minOccurs="0" name="userName" type="tns:UserName"/>
<xs:element minOccurs="0" name="password" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="setPasswordResponse">
<xs:sequence/>
</xs:complexType>
<xs:complexType name="createGroup">
<xs:sequence>
<xs:element minOccurs="0" name="groupName" type="xs:string"/>
<xs:element minOccurs="0" name="displayName" type="xs:string"/>
<xs:element minOccurs="0" name="email" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="createGroupResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="tns:GroupPrincipal"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="getUserById">
<xs:sequence>
<xs:element minOccurs="0" name="id" type="ns1:GUID"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="getUserByIdResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="tns:UserPrincipal"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://spotfire.tibco.com/ws/pub/2013/03/faults.xsd" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://spotfire.tibco.com/ws/pub/2013/03/faults.xsd">
<xs:element name="FaultInfo" type="tns:FaultInfo"/>
<xs:complexType name="FaultInfo">
<xs:sequence>
<xs:element name="errorCode" type="xs:string"/>
<xs:element name="message" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="UserDirectoryServiceException" nillable="true" type="tns:FaultInfo"/>
</xs:schema>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://spotfire.tibco.com/ws/pub/2013/03/common.xsd" version="1.0">
<xs:simpleType name="GUID">
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:schema>
</wsdl:types>
<wsdl:message name="setMembers">
<wsdl:part element="tns:setMembers" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getImmediateGroupsResponse">
<wsdl:part element="tns:getImmediateGroupsResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="setMembersResponse">
<wsdl:part element="tns:setMembersResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="removePrincipalsResponse">
<wsdl:part element="tns:removePrincipalsResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="UserDirectoryServiceException">
<wsdl:part element="ns1:UserDirectoryServiceException" name="UserDirectoryServiceException">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getUserByNameResponse">
<wsdl:part element="tns:getUserByNameResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getMembersResponse">
<wsdl:part element="tns:getMembersResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="setDisplayNameResponse">
<wsdl:part element="tns:setDisplayNameResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="setDisplayName">
<wsdl:part element="tns:setDisplayName" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="searchUsers">
<wsdl:part element="tns:searchUsers" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="searchGroups">
<wsdl:part element="tns:searchGroups" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="searchUsersResponse">
<wsdl:part element="tns:searchUsersResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="isMember">
<wsdl:part element="tns:isMember" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getUserByIdResponse">
<wsdl:part element="tns:getUserByIdResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="isMemberResponse">
<wsdl:part element="tns:isMemberResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getAllGroupsResponse">
<wsdl:part element="tns:getAllGroupsResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="setName">
<wsdl:part element="tns:setName" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="searchGroupsResponse">
<wsdl:part element="tns:searchGroupsResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getAllGroups">
<wsdl:part element="tns:getAllGroups" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="setPassword">
<wsdl:part element="tns:setPassword" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getUserById">
<wsdl:part element="tns:getUserById" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getImmediateGroups">
<wsdl:part element="tns:getImmediateGroups" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="addMembersResponse">
<wsdl:part element="tns:addMembersResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getMembers">
<wsdl:part element="tns:getMembers" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getUserByName">
<wsdl:part element="tns:getUserByName" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="setUserEnabled">
<wsdl:part element="tns:setUserEnabled" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="setEmailResponse">
<wsdl:part element="tns:setEmailResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="createUser">
<wsdl:part element="tns:createUser" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="setUserEnabledResponse">
<wsdl:part element="tns:setUserEnabledResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getGroupById">
<wsdl:part element="tns:getGroupById" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="setPasswordResponse">
<wsdl:part element="tns:setPasswordResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="createGroupResponse">
<wsdl:part element="tns:createGroupResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="addMembers">
<wsdl:part element="tns:addMembers" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="setEmail">
<wsdl:part element="tns:setEmail" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getGroupByNameResponse">
<wsdl:part element="tns:getGroupByNameResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="removeMembersResponse">
<wsdl:part element="tns:removeMembersResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getGroupByIdResponse">
<wsdl:part element="tns:getGroupByIdResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="removePrincipals">
<wsdl:part element="tns:removePrincipals" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="createUserResponse">
<wsdl:part element="tns:createUserResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="removeMembers">
<wsdl:part element="tns:removeMembers" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getGroupByName">
<wsdl:part element="tns:getGroupByName" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="setNameResponse">
<wsdl:part element="tns:setNameResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="createGroup">
<wsdl:part element="tns:createGroup" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="UserDirectoryService">
<wsdl:operation name="getImmediateGroups">
<wsdl:input message="tns:getImmediateGroups" name="getImmediateGroups">
</wsdl:input>
<wsdl:output message="tns:getImmediateGroupsResponse" name="getImmediateGroupsResponse">
</wsdl:output>
<wsdl:fault message="tns:UserDirectoryServiceException" name="UserDirectoryServiceException">
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="getMembers">
<wsdl:input message="tns:getMembers" name="getMembers">
</wsdl:input>
<wsdl:output message="tns:getMembersResponse" name="getMembersResponse">
</wsdl:output>
<wsdl:fault message="tns:UserDirectoryServiceException" name="UserDirectoryServiceException">
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="getUserByName">
<wsdl:input message="tns:getUserByName" name="getUserByName">
</wsdl:input>
<wsdl:output message="tns:getUserByNameResponse" name="getUserByNameResponse">
</wsdl:output>
<wsdl:fault message="tns:UserDirectoryServiceException" name="UserDirectoryServiceException">
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="setUserEnabled">
<wsdl:input message="tns:setUserEnabled" name="setUserEnabled">
</wsdl:input>
<wsdl:output message="tns:setUserEnabledResponse" name="setUserEnabledResponse">
</wsdl:output>
<wsdl:fault message="tns:UserDirectoryServiceException" name="UserDirectoryServiceException">
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="createUser">
<wsdl:input message="tns:createUser" name="createUser">
</wsdl:input>
<wsdl:output message="tns:createUserResponse" name="createUserResponse">
</wsdl:output>
<wsdl:fault message="tns:UserDirectoryServiceException" name="UserDirectoryServiceException">
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="setMembers">
<wsdl:input message="tns:setMembers" name="setMembers">
</wsdl:input>
<wsdl:output message="tns:setMembersResponse" name="setMembersResponse">
</wsdl:output>
<wsdl:fault message="tns:UserDirectoryServiceException" name="UserDirectoryServiceException">
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="getGroupById">
<wsdl:input message="tns:getGroupById" name="getGroupById">
</wsdl:input>
<wsdl:output message="tns:getGroupByIdResponse" name="getGroupByIdResponse">
</wsdl:output>
<wsdl:fault message="tns:UserDirectoryServiceException" name="UserDirectoryServiceException">
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="addMembers">
<wsdl:input message="tns:addMembers" name="addMembers">
</wsdl:input>
<wsdl:output message="tns:addMembersResponse" name="addMembersResponse">
</wsdl:output>
<wsdl:fault message="tns:UserDirectoryServiceException" name="UserDirectoryServiceException">
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="setEmail">
<wsdl:input message="tns:setEmail" name="setEmail">
</wsdl:input>
<wsdl:output message="tns:setEmailResponse" name="setEmailResponse">
</wsdl:output>
<wsdl:fault message="tns:UserDirectoryServiceException" name="UserDirectoryServiceException">
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="setDisplayName">
<wsdl:input message="tns:setDisplayName" name="setDisplayName">
</wsdl:input>
<wsdl:output message="tns:setDisplayNameResponse" name="setDisplayNameResponse">
</wsdl:output>
<wsdl:fault message="tns:UserDirectoryServiceException" name="UserDirectoryServiceException">
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="searchUsers">
<wsdl:input message="tns:searchUsers" name="searchUsers">
</wsdl:input>
<wsdl:output message="tns:searchUsersResponse" name="searchUsersResponse">
</wsdl:output>
<wsdl:fault message="tns:UserDirectoryServiceException" name="UserDirectoryServiceException">
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="searchGroups">
<wsdl:input message="tns:searchGroups" name="searchGroups">
</wsdl:input>
<wsdl:output message="tns:searchGroupsResponse" name="searchGroupsResponse">
</wsdl:output>
<wsdl:fault message="tns:UserDirectoryServiceException" name="UserDirectoryServiceException">
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="isMember">
<wsdl:input message="tns:isMember" name="isMember">
</wsdl:input>
<wsdl:output message="tns:isMemberResponse" name="isMemberResponse">
</wsdl:output>
<wsdl:fault message="tns:UserDirectoryServiceException" name="UserDirectoryServiceException">
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="removePrincipals">
<wsdl:input message="tns:removePrincipals" name="removePrincipals">
</wsdl:input>
<wsdl:output message="tns:removePrincipalsResponse" name="removePrincipalsResponse">
</wsdl:output>
<wsdl:fault message="tns:UserDirectoryServiceException" name="UserDirectoryServiceException">
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="removeMembers">
<wsdl:input message="tns:removeMembers" name="removeMembers">
</wsdl:input>
<wsdl:output message="tns:removeMembersResponse" name="removeMembersResponse">
</wsdl:output>
<wsdl:fault message="tns:UserDirectoryServiceException" name="UserDirectoryServiceException">
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="getGroupByName">
<wsdl:input message="tns:getGroupByName" name="getGroupByName">
</wsdl:input>
<wsdl:output message="tns:getGroupByNameResponse" name="getGroupByNameResponse">
</wsdl:output>
<wsdl:fault message="tns:UserDirectoryServiceException" name="UserDirectoryServiceException">
</wsdl:fault>
</wsdl:operation>
For the project I'm working on we need to create a SOAP web service (using Spring boot). The actual interface and message format is defined by a WSDL. The problem is that from what I understand from the documentation (e.g. https://www.baeldung.com/spring-boot-soap-web-service), I actually need an XSD (the WSDL will be generated from that).
Since there is only the WSDL, I tried to create the XSD myself for use in the application. Here I have run in to a couple of problems, the biggest problem being that the request messages it accepts aren't the ones that are accepted by the WSDL.
The WSDL accepts requests which simply are named payment where mine require paymentRequest as the name of the body element. This is probably something simple, but I can't find how to fix this…
Simplified wsdl:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://xxx.yyy.com"
xmlns:impl="http://xxx.yyy.com"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<schema targetNamespace="http://xxx.yyy.com" xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="XxxTxnResponse">
<sequence>
<element name="resultCode" type="xsd:int"/>
</sequence>
</complexType>
<complexType name="XxxToken">
<sequence>
<element name="tokenId" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="PaymentTxnResponse">
<complexContent>
<extension base="impl:XxxTxnResponse">
<sequence>
<element name="transactionRef" type="xsd:int"/>
</sequence>
</extension>
</complexContent>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="paymentRequest">
<wsdl:part name="posId" type="xsd:string"/>
<wsdl:part name="amountCents" type="xsd:int"/>
<wsdl:part name="token" type="impl:XxxToken"/>
</wsdl:message>
<wsdl:message name="paymentResponse">
<wsdl:part name="paymentReturn" type="impl:PaymentTxnResponse"/>
</wsdl:message>
<wsdl:portType name="XxxTxnHost">
<wsdl:operation name="payment" parameterOrder="posId amountCents token">
<wsdl:input message="impl:paymentRequest" name="paymentRequest"/>
<wsdl:output message="impl:paymentResponse" name="paymentResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="XxxTxnHostSoapBinding" type="impl:XxxTxnHost">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="payment">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="paymentRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://xxx.yyy.com" use="encoded"/>
</wsdl:input>
<wsdl:output name="paymentResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://xxx.yyy.com" use="encoded"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="XxxTxnHostService">
<wsdl:port binding="impl:XxxTxnHostSoapBinding" name="XxxTxnHost">
<wsdlsoap:address location="wp.wsdl"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Example request:
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xxx="http://xxx.yyy.com">
<soapenv:Header/>
<soapenv:Body>
<xxx:payment soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<posId xsi:type="xsd:string">?</posId>
<amountCents xsi:type="xsd:int">?</amountCents>
<token xsi:type="xxx:XxxToken">
<tokenId xsi:type="xsd:string">?</tokenId>
</token>
</xxx:payment>
</soapenv:Body>
</soapenv:Envelope>
My simplified xsd:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://xxx.yyy.com"
xmlns:tns="http://xxx.yyy.com">
<xs:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<xs:complexType name="XxxTxnResponse">
<xs:sequence>
<xs:element name="resultCode" type="xs:int"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="XxxToken">
<xs:sequence>
<xs:element name="tokenId" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="PaymentTxnResponse">
<xs:complexContent>
<xs:extension base="tns:XxxTxnResponse">
<xs:sequence>
<xs:element name="transactionRef" type="xs:int"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="paymentRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="posId" type="xs:string"/>
<xs:element name="amountCents" type="xs:int"/>
<xs:element name="token" type="tns:XxxToken"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="paymentResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="paymentReturn" type="tns:PaymentTxnResponse"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Generated wsdl:
<?xml version="1.0" encoding="UTF-8" standalone="no"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:sch="http://xxx.yyy.com" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://xxx.yyy.com" targetNamespace="http://xxx.yyy.com">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xxx.yyy.com">
<xs:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<xs:complexType name="XxxTxnResponse">
<xs:sequence>
<xs:element name="resultCode" type="xs:int"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="XxxToken">
<xs:sequence>
<xs:element name="tokenId" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="PaymentTxnResponse">
<xs:complexContent>
<xs:extension base="tns:XxxTxnResponse">
<xs:sequence>
<xs:element name="transactionRef" type="xs:int"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="paymentRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="posId" type="xs:string"/>
<xs:element name="amountCents" type="xs:int"/>
<xs:element name="token" type="tns:XxxToken"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="paymentResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="paymentReturn" type="tns:PaymentTxnResponse"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="paymentResponse">
<wsdl:part element="tns:paymentResponse" name="paymentResponse">
</wsdl:part>
</wsdl:message>
<wsdl:message name="paymentRequest">
<wsdl:part element="tns:paymentRequest" name="paymentRequest">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="yyy">
<wsdl:operation name="payment">
<wsdl:input message="tns:paymentRequest" name="paymentRequest">
</wsdl:input>
<wsdl:output message="tns:paymentResponse" name="paymentResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="yyySoap11" type="tns:yyy">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="payment">
<soap:operation soapAction=""/>
<wsdl:input name="paymentRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="paymentResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="yyyService">
<wsdl:port binding="tns:yyySoap11" name="yyySoap11">
<soap:address location="http://localhost:8206/yyyservice/ws"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
There are a number of differences which I hope to solve in the end (no use of encoded is one), but the biggest problem is the fact that my wsdl requires paymentRequest in the request body, whereas the original message uses just payment. The response actually looked similar to what is expected.
I'm sure there something simple I have forgotten to do/specify, so hopefully one of you is able to point me in the right direction.
There is a difference in your bindings definitions. In the given wsdl there is specified that rpc/encoded is used while in your generated wsdl document/literal is used. Most likely you can set these settings before generating the wsdl.
If you alter the generated wsdl so it uses the prc/encoded the request looks like:
<SOAP-ENV:Body>
<m:payment xmlns:m="http://xxx.yyy.com">
<m:payment>
<posId xsi:type="xsd:string">String</posId>
<amountCents xsi:type="xsd:int">0</amountCents>
<token xsi:type="m:XxxToken">
<tokenId xsi:type="xsd:string">String</tokenId>
</token>
</m:payment>
</m:payment>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
see https://learn.microsoft.com/en-us/previous-versions/dotnet/articles/ms996486(v=msdn.10)?redirectedfrom=MSDN#understand_topic6
OK, after loads of trial and error, I managed to find a different solution with which I was able to consume the messages.
I didn't like my earlier attempt where I renamed paymentRequest to just payment since when looking at the wsdl, I saw all the “input” parts missing from the operations. This didn't feel good.
However, by simply specifying the type
<xs:complexType name="PaymentRequest">
<xs:sequence>
<xs:element name="posId" type="xs:string"/>
<xs:element name="amountCents" type="xs:int"/>
<xs:element name="token" type="tns:XxxToken"/>
</xs:sequence>
</xs:complexType>
and the element
<xs:element name="paymentRequest" type ="PaymentRequest">
separately, it worked, and now with the input parts showing properly again in the WSDL.
Digging around a little more, it follows the main issue is actually (fully) caused by the original WSDL using RPC/encoded instead of Document/Literal (as already suggested by #martijn in his answer). As it turns out RPC/encoded is actually deprecated (quite a number of years now…) and doesn't seem to be supported by Spring.
So unless someone knows how to get Spring to use RPC/encoded, I guess I need to go back to the company that is asking me to develop a server to communicate with their hardware and make them allow Document/literal responses (at least).
Im trying to consume an RPC-Style Soap WebService with Spring, I'm using this guide http://spring.io/guides/gs/consuming-web-service/ as an example. I'm stuck at the "...WebServiceTemplate().marshalSendAndReceive(request..." because the XJC task doesnt generate the resquest Class, this is the wsdl of the service im trying to implement:
<wsdl:definitions name="AuthenticationService" targetNamespace="http://authservices.ws.gt.company.com/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://authservices.ws.gt.company.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<xs:schema targetNamespace="http://authservices.ws.gt.company.com/" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="userInformationResponse">
<xs:sequence>
<xs:element minOccurs="0" name="alias" type="xs:string"/>
<xs:element minOccurs="0" name="bussinessPhone" type="xs:string"/>
<xs:element minOccurs="0" name="department" type="xs:string"/>
<xs:element minOccurs="0" name="email" type="xs:string"/>
<xs:element minOccurs="0" name="errorMessage" type="xs:string"/>
<xs:element minOccurs="0" name="firt" type="xs:string"/>
<xs:element minOccurs="0" name="groups" type="tns:userInformationGroups"/>
<xs:element minOccurs="0" name="last" type="xs:string"/>
<xs:element minOccurs="0" name="mobilePhone" type="xs:string"/>
<xs:element minOccurs="0" name="title" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="userInformationGroups">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="group" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="requestUserInfo">
<wsdl:part name="ldapId" type="xsd:int"/>
<wsdl:part name="user" type="xsd:string"/>
<wsdl:part name="password" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="requestUserInfoResponse">
<wsdl:part name="userInfo" type="tns:userInformationResponse"/>
</wsdl:message>
<wsdl:portType name="AuthService">
<wsdl:operation name="requestUserInfo">
<wsdl:input message="tns:requestUserInfo" name="requestUserInfo"/>
<wsdl:output message="tns:requestUserInfoResponse" name="requestUserInfoResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="AuthenticationServiceSoapBinding" type="tns:AuthService">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="requestUserInfo">
<soap:operation soapAction="" style="rpc"/>
<wsdl:input name="requestUserInfo">
<soap:body namespace="http://authservices.ws.gt.company.com/" use="literal"/>
</wsdl:input>
<wsdl:output name="requestUserInfoResponse">
<soap:body namespace="http://authservices.ws.gt.company.com/" use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="AuthenticationService">
<wsdl:port binding="tns:AuthenticationServiceSoapBinding" name="AuthServicePort">
<soap:address location="http://HOST/authservices/AuthService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
When one usually creates a SOAP request and response element, it would end in __Request and __Response and SoapUI would pick it up when you import the WSDL.
<xs:element name="SampleRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="Testing" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SampleResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Testing" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
I'm busy converting a piece of old VB6 code and the DTD's SOAP equivalent would use the same element for request and response:
<xs:element name="Sample">
<xs:complexType>
<xs:sequence>
<xs:element name="Testing" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
Is there something I can set in the XSD so that SOAPUI would pick up Sample as both a request and a response?
When SOAPUI reads the WSDL, it uses the element (and therefore the element name) defined in the wsdl:message element which is referenced from the wsdl:operation element as the request, response, and optional fault. Nothing you do to an XSD will change that. Nor do elements have to end with "Request" to be considered a request (same for Response).
Solved it by replacing all SampleRequest and SampleResponse with just Sample and removing the now duplicate wsdl:message:
...
<wsdl:message name="Sample">
<wsdl:part element="tns:Sample" name="Sample">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="SampleSoapService">
<wsdl:operation name="Sample">
<wsdl:input message="tns:Sample" name="Sample">
</wsdl:input>
<wsdl:output message="tns:Sample" name="Sample">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="SampleSoapServiceSoap11" type="tns:SampleSoapService">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="Sample">
<soap:operation soapAction="" />
<wsdl:input name="Sample">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="Sample">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="SampleSoapServiceService">
<wsdl:port binding="tns:SampleSoapServiceSoap11" name="SampleSoapServiceSoap11">
<soap:address location="http://localhost:8080/paygate-SampleSoapService/ws/SampleSoapService" />
</wsdl:port>
</wsdl:service>
I have a problem with my SOAP request. When I have tried the below soap request to the server then it returns the
expected result.
Location : https://YOUR_SERVER/apitransactional/services/TransactionalService?wsdl
Input:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:api="http://api.service.apitransactional.emailvision.com/">
<soapenv:Header/>
<soapenv:Body>
<api:openApiConnection>
<login>usernaem</login>
<pwd>password</pwd>
<key>security-key</key>
</api:openApiConnection>
</soapenv:Body>
</soapenv:Envelope>
Output:
<soap:Envelope>
<soap:Body>
<ns2:openApiConnectionResponse>
<return>G9X7CsNn3HisxFdwAu4W76mBewQgH9WW-3CyeO9WBMiHXX_u9ufLHDkA-NypiiYFGh7FLbEz2_c1YonjauDs7Jhk9DGvGNSTLMTjdz5wT2V20E4m3axKPzEnjrvzC63ItFzBIYIeYXHxjKf3w9Yxmmhz5SSeXg</return>
</ns2:openApiConnectionResponse>
</soap:Body>
</soap:Envelope>
It returns token of this connection.
But when I tried to the below request then it returns the whole wsdl file instead of
success / fail response.
Location: http://api.notificationmessaging.com/NMSOAP/NotificationService?wsdl
Input:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:api="http://api.service.nsapi.emailvision.com/">
<soapenv:Header/>
<soapenv:Body>
<api:sendObjectsWithFullStatus>
<arg0>
<sendrequest>
<content>
<entry>
<key>1</key>
<value>>
<![CDATA[
<table width="600">
<tr>
<td>
<font size="2" face="Arial">Our powerful algorithms
already found a matching profile that matches your criteria:
<br>Celina72 </font>
<img src="http://mypath/to/my/image.gif" width="50"
height="50" border="0" />
</td>]]></value>
</entry>
</content>
<dyn>
<entry>
<key>firstname</key>
<value>john</value>
</entry>
</dyn>
<email>jblum#flowerpowershop.biz</email>
<encrypt>BdX7CqkmjTHtxWEKB5QK6MzXKkx6HK3E8guM</encrypt>
<notificationId>1234</notificationId>
<random>4A776E3602000078</random>
<senddate>2008-12-12T00:00:00</senddate>
<synchrotype>NOTHING</synchrotype>
<uidkey>EMAIL</uidkey>
</sendrequest>
<sendrequest>
<content>
<entry>
<key>1</key>
<value>>
<![CDATA[
<table width="600">
<tr>
<td>
<font size="2" face="Arial">Our powerful
algorithms already found a matching profile that matches your criteria:
<br>Celina72 </font>
<img src="http://mypath/to/my/image.gif" width-
h="50" height="50" border="0" />
</td>]]></value>
</entry>
</content>
<dyn>
<entry>
<key>firstname</key>
<value>David</value>
</entry>
</dyn>
<email>dcoulon#flowerpowershop.biz</email>
<encrypt>BdX7CqkmjTHtxWEKB5QK6MzXKkx6HK3E8guM</encrypt>
<notificationId>1234</notificationId>
<random>4A776E3602000078</random>
<senddate>2008-12-12T00:00:00</senddate>
<synchrotype>UPDATE</synchrotype>
<uidkey>EMAIL</uidkey>
</sendrequest>
</arg0>
</api:sendObjectsWithFullStatus>
</soapenv:Body>
</soapenv:Envelope>
Output:
<?xml version='1.0' encoding='UTF-8' ?>
<wsdl:definitions name="NotificationServiceService" targetNamespace="http://api.service.nsapi.emailvision.com/">
<wsdl:types>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://api.service.nsapi.emailvision.com/">
<xs:element name="MultiSendRequest" type="tns:multiSendRequest" />
<xs:element name="MultiSendRequestResponse" type="tns:multiSendRequestResponse" />
<xs:element name="getSendRequestById" type="tns:getSendRequestById" />
<xs:element name="getSendRequestByIdResponse" type="tns:getSendRequestByIdResponse" />
<xs:element name="notificationExceptionDetails" type="tns:notificationExceptionDetails" />
<xs:element name="sendObject" type="tns:sendObject" />
<xs:element name="sendObjectResponse" type="tns:sendObjectResponse" />
<xs:element name="sendObjects" type="tns:sendObjects" />
<xs:element name="sendObjectsResponse" type="tns:sendObjectsResponse" />
<xs:element name="sendObjectsWithFullStatus" type="tns:sendObjectsWithFullStatus" />
<xs:element name="sendObjectsWithFullStatusResponse" type="tns:sendObjectsWithFullStatusResponse" />
<xs:element name="sendrequest" type="tns:sendRequest" />
<xs:element name="sendrequestresponse" type="tns:sendRequestResponse" />
<xs:complexType name="sendObjects">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="tns:multiSendRequest" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="multiSendRequest">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="sendrequest" nillable="true" type="tns:sendRequest" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="sendRequest">
<xs:sequence>
<xs:element name="content">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="entry">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="key" type="xs:int" />
<xs:element minOccurs="0" name="value" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="dyn">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="entry">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="key" type="xs:string" />
<xs:element minOccurs="0" name="value" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="email" type="xs:string" />
<xs:element minOccurs="0" name="encrypt" type="xs:string" />
<xs:element name="notificationId" type="xs:long" />
<xs:element minOccurs="0" name="random" type="xs:string" />
<xs:element minOccurs="0" name="senddate" type="xs:dateTime" />
<xs:element minOccurs="0" name="synchrotype" type="tns:synchroType" />
<xs:element minOccurs="0" name="uidkey" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="sendObjectsResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="tns:multiSendRequestResponse" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="multiSendRequestResponse">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="element" nillable="true" type="tns:notificationServiceResponse" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="notificationServiceResponse">
<xs:sequence>
<xs:element minOccurs="0" name="result" type="xs:anyType" />
</xs:sequence>
<xs:attribute name="email" type="xs:string" />
<xs:attribute name="responseStatus" type="xs:string" />
</xs:complexType>
<xs:complexType name="notificationExceptionDetails">
<xs:sequence>
<xs:element minOccurs="0" name="description" type="xs:string" />
<xs:element maxOccurs="unbounded" minOccurs="0" name="fields" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="status" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="getSendRequestById">
<xs:sequence>
<xs:element name="arg0" type="xs:long" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element minOccurs="0" name="arg2" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="getSendRequestByIdResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="tns:sendRequestResponse" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="sendRequestResponse">
<xs:sequence>
<xs:element minOccurs="0" name="email" type="xs:string" />
<xs:element name="id" type="xs:long" />
<xs:element name="notificationId" type="xs:long" />
<xs:element minOccurs="0" name="processDate" type="xs:dateTime" />
<xs:element minOccurs="0" name="requestDate" type="xs:dateTime" />
<xs:element minOccurs="0" name="sendDate" type="xs:dateTime" />
<xs:element minOccurs="0" name="status" type="xs:string" />
<xs:element minOccurs="0" name="UId" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="sendObject">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="tns:sendRequest" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="sendObjectResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="sendObjectsWithFullStatus">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="tns:multiSendRequest" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="sendObjectsWithFullStatusResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="tns:multiSendRequestResponse" />
</xs:sequence>
</xs:complexType>
<xs:simpleType name="synchroType">
<xs:restriction base="xs:string">
<xs:enumeration value="NOTHING" />
<xs:enumeration value="INSERT" />
<xs:enumeration value="UPDATE" />
<xs:enumeration value="INSERT_UPDATE" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://exceptions.service.nsapi.emailvision.com/">
<xsd:element name="NotificationServiceException" nillable="true" type="ns0:notificationExceptionDetails" />
</xsd:schema>
</wsdl:types>
<wsdl:message name="getSendRequestByIdResponse">
<wsdl:part element="tns:getSendRequestByIdResponse" name="parameters" />
</wsdl:message>
<wsdl:message name="sendObjectsWithFullStatus">
<wsdl:part element="tns:sendObjectsWithFullStatus" name="parameters" />
</wsdl:message>
<wsdl:message name="NotificationServiceException">
<wsdl:part element="ns1:NotificationServiceException" name="NotificationServiceException" />
</wsdl:message>
<wsdl:message name="sendObjectResponse">
<wsdl:part element="tns:sendObjectResponse" name="parameters" />
</wsdl:message>
<wsdl:message name="sendObjectsResponse">
<wsdl:part element="tns:sendObjectsResponse" name="parameters" />
</wsdl:message>
<wsdl:message name="getSendRequestById">
<wsdl:part element="tns:getSendRequestById" name="parameters" />
</wsdl:message>
<wsdl:message name="sendObjectsWithFullStatusResponse">
<wsdl:part element="tns:sendObjectsWithFullStatusResponse" name="parameters" />
</wsdl:message>
<wsdl:message name="sendObjects">
<wsdl:part element="tns:sendObjects" name="parameters" />
</wsdl:message>
<wsdl:message name="sendObject">
<wsdl:part element="tns:sendObject" name="parameters" />
</wsdl:message>
<wsdl:portType name="NotificationService">
<wsdl:operation name="sendObjects">
<wsdl:input message="tns:sendObjects" name="sendObjects" />
<wsdl:output message="tns:sendObjectsResponse" name="sendObjectsResponse" />
<wsdl:fault message="tns:NotificationServiceException" name="NotificationServiceException" />
</wsdl:operation>
<wsdl:operation name="getSendRequestById">
<wsdl:input message="tns:getSendRequestById" name="getSendRequestById" />
<wsdl:output message="tns:getSendRequestByIdResponse" name="getSendRequestByIdResponse" />
<wsdl:fault message="tns:NotificationServiceException" name="NotificationServiceException" />
</wsdl:operation>
<wsdl:operation name="sendObject">
<wsdl:input message="tns:sendObject" name="sendObject" />
<wsdl:output message="tns:sendObjectResponse" name="sendObjectResponse" />
<wsdl:fault message="tns:NotificationServiceException" name="NotificationServiceException" />
</wsdl:operation>
<wsdl:operation name="sendObjectsWithFullStatus">
<wsdl:input message="tns:sendObjectsWithFullStatus" name="sendObjectsWithFullStatus" />
<wsdl:output message="tns:sendObjectsWithFullStatusResponse" name="sendObjectsWithFullStatusResponse" />
<wsdl:fault message="tns:NotificationServiceException" name="NotificationServiceException" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="NotificationServiceServiceSoapBinding" type="tns:NotificationService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="sendObjects">
<soap:operation soapAction="" style="document" />
<wsdl:input name="sendObjects">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="sendObjectsResponse">
<soap:body use="literal" />
</wsdl:output>
<wsdl:fault name="NotificationServiceException">
<soap:fault name="NotificationServiceException" use="literal" />
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="getSendRequestById">
<soap:operation soapAction="" style="document" />
<wsdl:input name="getSendRequestById">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="getSendRequestByIdResponse">
<soap:body use="literal" />
</wsdl:output>
<wsdl:fault name="NotificationServiceException">
<soap:fault name="NotificationServiceException" use="literal" />
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="sendObject">
<soap:operation soapAction="" style="document" />
<wsdl:input name="sendObject">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="sendObjectResponse">
<soap:body use="literal" />
</wsdl:output>
<wsdl:fault name="NotificationServiceException">
<soap:fault name="NotificationServiceException" use="literal" />
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="sendObjectsWithFullStatus">
<soap:operation soapAction="" style="document" />
<wsdl:input name="sendObjectsWithFullStatus">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="sendObjectsWithFullStatusResponse">
<soap:body use="literal" />
</wsdl:output>
<wsdl:fault name="NotificationServiceException">
<soap:fault name="NotificationServiceException" use="literal" />
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="NotificationServiceService">
<wsdl:port binding="tns:NotificationServiceServiceSoapBinding" name="NotificationServicePort">
<soap:address location="http://api.notificationmessaging.com/nsapi/services/NotificationService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Expected Output:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:sendObjectResponse xmlns:n-
s2="http://api.service.nsapi.emailvision.com/">
<return>SendRequest has been successfully saved!</return>
</ns2:sendObjectResponse>
</soap:Body>
</soap:Envelope>
Can anyone suggest what is the actual problem is?
Does this problem from my request or from the server response?
Is there a specific reason to add ?wsdl to your endpoint address? Response from server(http://api.notificationmessaging.com/NMSOAP/NotificationService) is, not what you expected but definitely not WSLD
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:sendObjectsWithFullStatusResponse xmlns:ns2="http://api.service.nsapi.emailvision.com/">
<return>
<element responseStatus="failed" email="jblum#flowerpowershop.biz">
<result xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns4="http://www.w3.org/2001/XMLSchema" xsi:type="ns4:string">
Query random: 4A776E3602000078 doesnt match with notification random: {1} !!!
</result>
</element>
<element responseStatus="failed" email="dcoulon#flowerpowershop.biz">
<result xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns4="http://www.w3.org/2001/XMLSchema" xsi:type="ns4:string">
Query random: 4A776E3602000078 doesnt match with notification random: {1} !!!
</result>
</element>
</return>
</ns2:sendObjectsWithFullStatusResponse>
</soap:Body>
</soap:Envelope>
Can you check that particular operation mplementation at server side. It must have been sending that wsdl in response instead of your desired response. Also you can check your soap action once, may be due to wrong soap action server is filtering your request by sending you a wsdl, Though i am not seeing any soap action in your wsdl.
I have tried this wsdl in soapui, i am getting proper response from it.Though it is unsuccessful.
Query random: 4A776E3602000078 doesnt match with notification random: {1} !!!
Query random: 4A776E3602000078 doesnt match with notification random: {1} !!!