I am trying to construct a hand rolled HTTP request in order to return a response from what I thought was a fairly simple SOAP web service call. However, I am having trouble constructing the request properly, and am not getting the response I expect.
Applicable wsdl statements:
wsdl Target Namespace:
targetNamespace="http://tempuri.org/"
wsdl Service
<wsdl:service name="TrackerService">
<wsdl:port name="BasicHttpBinding_ITrackerService" binding="tns:BasicHttpBinding_ITrackerService">
<soap:address location="http://mydomain.com/TrackerServiceSite/wctest2.TrackerService.svc"/>
</wsdl:port>
</wsdl:service>
wsdl Message
<wsdl:message name="ITrackerService_GetStub_InputMessage">
<wsdl:part name="parameters" element="tns:GetStub" />
</wsdl:message>
<wsdl:message name="ITrackerService_GetStub_OutputMessage">
<wsdl:part name="parameters" element="tns:GetStubResponse" />
</wsdl:message>
wsdl Binding and SOAP Operation
<wsdl:binding name="BasicHttpBinding_ITrackerService" type="tns:ITrackerService">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
.
. <!—- Omitted for brevity -->
.
<wsdl:operation name="GetStub">
<soap:operation soapAction="http://tempuri.org/ITrackerService/GetStub" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
EXPECTED Return Response
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header />
<s:Body>
<GetStubResponse xmlns="http://tempuri.org/">
<GetStubResult xmlns:a=http://schemas.datacontract.org/2004/07/wctest2 xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:Password>SOMEPASS</a:Password>
<a:Username>SOMEUSER</a:Username>
</GetStubResult>
</GetStubResponse>
</s:Body>
</s:Envelope>
HTTP request thus far:
POST http://mydomain.com/TrackerServiceSite/wctest2.TrackerService.svc HTTP/1.1
Content-Type: text/xml; charset="utf-8"
Content-Length: 297
Host: mydomain.com
<soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetStub xmlns="http://tempuri.org/"/>
</soap:Body>
</soap:Envelope>
HTTP Response
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode xmlns:a="http://schemas.microsoft.com/ws/2005/05/addressing/none">a:ActionNotSupported</faultcode>
<faultstring xml:lang="en-US">
The message with Action '' cannot be processed at the receiver, due to a
ContractFilter mismatch at the EndpointDispatcher. This may be because of
either a contract mismatch (mismatched Actions between sender and receiver)
or a binding/security mismatch between the sender and the receiver. Check
that sender and receiver have the same contract and the same binding
(including security requirements, e.g. Message, Transport, None).
</faultstring>
</s:Fault>
</s:Body>
</s:Envelope>
I am pretty sure that I need to include a soapAction from the wsdl file somewhere in my request, but I'm not sure where to include it. What else am I missing? Any help would be greatly appreciated.
Place your soap action in the SOAPAction HTTP header
Related
I'm kind of new with this Jmeter thing and I'm trying to do a simple SOAP/XML-RPC request on Jmeter. I'm using an example code I found on internet, that seems to work pretty fine (at least using Wizlet in Chrome didn't seem to have a problem), but when I use the soap request that generates the plug-in on the element in Jmeter... Well thats a different story. If someone could tell me the problem it would be awesome.
This is the code of the WSDL:
<wsdl:definitions xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://jee.javapapers.com" xmlns:intf="http://jee.javapapers.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://jee.javapapers.com">
<!--
WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)
-->
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://jee.javapapers.com">
<element name="animalType">
<complexType>
<sequence>
<element name="animal" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="animalTypeResponse">
<complexType>
<sequence>
<element name="animalTypeReturn" type="xsd:string"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="animalTypeResponse">
<wsdl:part element="impl:animalTypeResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="animalTypeRequest">
<wsdl:part element="impl:animalType" name="parameters"/>
</wsdl:message>
<wsdl:portType name="AnimalTypeService">
<wsdl:operation name="animalType">
<wsdl:input message="impl:animalTypeRequest" name="animalTypeRequest"/>
<wsdl:output message="impl:animalTypeResponse" name="animalTypeResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="AnimalTypeServiceSoapBinding" type="impl:AnimalTypeService">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="animalType">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="animalTypeRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="animalTypeResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="AnimalTypeServiceService">
<wsdl:port binding="impl:AnimalTypeServiceSoapBinding" name="AnimalTypeService">
<wsdlsoap:address location="http://localhost:8082/WebServicesAnimals/services/AnimalTypeService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
And this is the request i'm sending and the response error.
URL: http://localhost:8082/WebServicesAnimals/services/AnimalTypeService?WSDL
BODY:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<animalType xmlns="http://jee.javapapers.com">
<animal>Lion</animal>
</animalType>
</soapenv:Body>
</soapenv:Envelope>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode xmlns:ns1="http://xml.apache.org/axis/">ns1:Client.NoSOAPAction</faultcode>
<faultstring>no SOAPAction header!</faultstring>
<detail>
<ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">WBFINF05</ns2:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
I see at least 2 problems:
Why are you sending your request to the URL ending with ?WSDL, you should use:
http://localhost:8082/WebServicesAnimals/services/AnimalTypeService
Error says you don't have a SOAPAction. If you confirm you didn't set it, add a Header Manager and set soapAction to ""
Finally you should use regular HTTP REquest instead of SOAP/XML-RPC Request as per this tutorial:
https://jmeter.apache.org/usermanual/build-ws-test-plan.html
Say my WSDL contains the following:
<message name="modifRequest">
<part name="siList" element="sn:siListElement"/>
</message>
<message name="modifResponse">
<part name="siList" element="sn:boolElement"/>
</message>
<portType name="siModificationPortType">
<operation name="delete">
<input message="tns:modifRequest" />
<output message="tns:modifResponse" />
</operation>
<operation name="update">
<input message="tns:modifRequest" />
<output message="tns:modifResponse" />
</operation>
</portType>
Which generates the following SOAP client message in SoapUI, whether in an update or a delete request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sim="simSchema">
<soapenv:Header/>
<soapenv:Body>
<sim:siListElement>
<!--1 or more repetitions:-->
<sim:si name="?" desc="?" workspace="workspace">
<!--Zero or more repetitions:-->
<sim:bp name="?" value="?" bps="?"/>
</sim:si>
</sim:siListElement>
So it seems that the only thing sent through HTTP to the WS is the siListElement. But how does the WS know the operation the client wants to reach (here, delete/update)? Especially in that case where the inputs of both operations have the same structure.
The WS know the operation through SOAPAction HTTP Header. When you create a new SOAP Test request in SOAPUI you have to select the operation and choosing it then SOAPUI automatically sets the operation for you request an maps this operation to the necessary SOAPAction which it will send as HTTP header when you run the test request.
This "magic" happens because in your WSDL surely there is also a information which you are missing in your question which is binding the wsdl:operation against soap:operation. In your WSDL probably there are something like:
<binding name="bindingDelete" type="siModificationPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="delete">
<soap:operation soapAction="delete"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<binding name="bindingAdd" type="siModificationPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="add">
<soap:operation soapAction="add"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
So when you specify to SOAPUI that your operation is delete then SOAPUI is sending SOAPAction http header with the correct value like for example delete, instead of you specify add operation then SOAPAction http header with some value like add is send.
You can check what I'm saying runing your request and clicking on the Raw tab on the left side of your SOAPRequest and checking the different SOAPAction values for your operation types:
Hope this helps,
I have a problem with a service wsdl that is delivered by a third party. Let my try to explain. Take this wsdl part:
<wsdl:portType name="IBestelService">
<wsdl:operation name="PlaatsOrder">
<wsdl:input message="tns:PlaatsOrderRequest"/>
<wsdl:output message="tns:PlaatsOrderResponse"/>
<wsdl:fault message="tns:BestelServiceFault" name="BestelServiceFault"/>
</wsdl:operation>
<wsdl:operation name="PlaatsOrderThreeShips">
<wsdl:input message="tns:PlaatsOrderRequestThreeShips"/>
<wsdl:output message="tns:PlaatsOrderResponseThreeShips"/>
<wsdl:fault message="tns:BestelServiceFault" name="BestelServiceFault"/>
</wsdl:operation>
</wsdl:portType>
For the request soapui (and .net to) generates the following request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sambo-ict:basetypes:1.0" xmlns:urn1="urn:sambo-ict:bestelservice:types:1.0">
<soapenv:Header>
<urn:AuthenticationHeader xmlns="urn:sambo-ict:basetypes:1.0"/>
</soapenv:Header>
<soapenv:Body>
<urn1:PlaatsOrderRequest>
<EAN>9789490998394</EAN>
<DistributorOrderId>13188</DistributorOrderId>
<DeliveryMethod>Tegoed</DeliveryMethod>
<Amount>1</Amount>
</urn1:PlaatsOrderRequest>
</soapenv:Body>
</soapenv:Envelope>
However the service at the third party site expects this
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sambo-ict:basetypes:1.0" xmlns:urn1="urn:sambo-ict:bestelservice:types:1.0">
<soapenv:Header>
<urn:AuthenticationHeader xmlns="urn:sambo-ict:basetypes:1.0"/>
</soapenv:Header>
<soapenv:Body>
<urn1:PlaatsOrder>
<EAN>9789490998394</EAN>
<DistributorOrderId>13188</DistributorOrderId>
<DeliveryMethod>Tegoed</DeliveryMethod>
<Amount>1</Amount>
</urn1:PlaatsOrder>
</soapenv:Body>
</soapenv:Envelope>
When I search the internet on soap. The "plaatsorder" instead of "plaatsorderrequest" seems to be the right way. However I do not believe that both soapui/java and .net have it wrong. So can anyone explain the difference to me?
The element:
<wsdl:input message="tns:PlaatsOrderRequest"/>
will have an associated message entry that looks like:
<wsdl:message name="PlaatsOrderRequest">
<wsdl:part element="urn1:PlaatsOrderRequest" name="parameters" />
</wsdl:message>
That element name is what dictates the wrapped request element, assuming this is a document/literal wrapped service (which they usually are). I would need the full WSDL and schema to be more definitive.
You can make this change by yourself in wsdl. It's easy just replace that tag whichever is required. It would work.
by the way you can directly ask your client by providing right wsdl with this change. It would be easy for them to generate wsdl with required request tag.
I have to make a request to a web service, that uses Axis2, I'm too close to have it working but i keep getting error messages and i'm sure it is in the construction of my SOAP XML. This was the SOAP:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Header>
<RequestsoapHeader>
<spId>SPID</spId>
<spPassword>RandomPass</spPassword>
<timeStamp>20130115160251</timeStamp>
</RequestsoapHeader>
</soap:Header>
<soap:Body>
<operation>
<name>getSPToken</name>
<input>http://zzz.zzz.zzz.zzz/my/redirection/url/</input>
</operation>
</soap:Body>
</soap:Envelope>
UPDATE!!!! Now the soap is this:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Header>
<RequestsoapHeader>
<spId>SPID</spId>
<spPassword>RandomPass</spPassword>
<timeStamp>20130115160251</timeStamp>
</RequestsoapHeader>
</soap:Header>
<soap:Body>
<getSPTokenRequest>
<SPredirectURL>http://zzz.zzz.zzz.zzz/my/redirection/url/</SPredirectURL>
</getSPTokenRequest>
</soap:Body>
</soap:Envelope>
The part i can't fix is the Body, i tried to call the operation in different ways, for example instead of <operation> i used <operation name="getSPToken">, i also tried not using operation and created a tag with the name: <getSPToken>, but nothing works.
This is the WSDL part that describes the operation i'm trying to call in the Web Service:
<wsdl:operation name="getSPToken">
<soap:operation soapAction="" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="ServiceException">
<soap:fault name="ServiceException" use="literal"/>
</wsdl:fault>
<wsdl:fault name="PolicyException">
<soap:fault name="PolicyException" use="literal"/>
</wsdl:fault>
</wsdl:operation>
UPDATE!!! This is the interface XML (part of the WSDL) that i didn't post before:
<wsdl:types>
<xsd:schema elementFormDefault="qualified"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.csapi.org/schema/parlayx/sicoweb/v1_0/local">
<xsd:element name="getSPTokenRequest" type="osg_sicoweb_local_xsd:getSPTokenRequest"/>
<xsd:complexType name="getSPTokenRequest">
<xsd:sequence>
<xsd:element name="SPredirectURL"
type="xsd:string" maxOccurs="1" minOccurs="1">
<xsd:annotation>
<xsd:documentation></xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="getSPTokenResponse" type="osg_sicoweb_local_xsd:getSPTokenResponse"/>
<xsd:complexType name="getSPTokenResponse">
<xsd:sequence>
<xsd:element name="SPToken" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
And this is the response i was getting:
HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=UTF-8
Date: Tue, 15 Jan 2013 21:10:49 GMT
Connection: close
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault xmlns:axis2ns73="http://schemas.xmlsoap.org/soap/envelope/">
<faultcode>axis2ns73:Client</faultcode>
<faultstring>The endpoint reference (EPR) for the Operation not found is http://xxx.xxx.xxx.xxx:xxx/path/to/service/ and the WSA Action = </faultstring>
<detail />
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
UPDATE!!!! With the new changes, the response i'm getting is this one:
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>org.apache.axis2.databinding.ADBException: Unexpected subelement getSPTokenRequest</faultstring>
<detail />
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
The operation getSPToken receives one parameter called SPredirectURL, that contains a URL of redirection, please help.
Try one of the following as your body:
<soap:Body>
<SPredirectURL>http://zzz.zzz.zzz.zzz/my/redirection/url/</SPredirectURL>
</soap:Body>
<soap:Body>
<getSPTokenRequest xmlns="http://www.csapi.org/schema/parlayx/sicoweb/v1_0/local">
<SPredirectURL>http://zzz.zzz.zzz.zzz/my/redirection/url/</SPredirectURL>
</getSPTokenRequest>
</soap:Body>
Based on the WSDL snippet, the web service endpoint is using the document/literal convention for messages, but without the WSDL message declarations it is unclear whether the 'bare' (first example) or 'wrapped' (second example) version is expected. The post at this address (http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/) gives good insight into the various dialects described by WSDL.
UPDATE:
Based on the schema inside the wsdl:types section, the fully-qualified name for the element expected by the service (based on the declared targetNamespace attribute of the schema element) is http://www.csapi.org/schema/parlayx/sicoweb/v1_0/local{getSPTokenRequest}
One way of establishing that name (inline namespace declaration) is shown in the updated second body above.
Post back with the next iteration.
Right now, I have a service called ProcessPayment that calls a billing system. As we can see here, I want to make a call to another billing service from my payment service. The response from PaymentService has 3 data elements. One of them is required in BillingService.
How do I configure the flow for two or more services in Mule? I have tried various permutations but it just does not work!
Mule-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:ognl="http://www.mulesoft.org/schema/mule/ognl" xmlns:servlet="http://www.mulesoft.org/schema/mule/servlet"
xmlns:vm="http://www.mulesoft.org/schema/mule/vm" xmlns:pattern="http://www.mulesoft.org/schema/mule/pattern"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
http://www.mulesoft.org/schema/mule/pattern http://www.mulesoft.org/schema/mule/pattern/3.1/mule-pattern.xsd
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ognl http://www.mulesoft.org/schema/mule/ognl/current/mule-ognl.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd">
<!-- <flow name="parallelservices"> <all enableCorrelation="ALWAYS"> <cxf:proxy-service
wsdlLocation="classpath:billingservice.wsdl" bindingId="BillingServiceServiceSoapBinding"
port="BillingServicePort" service="BillingServiceService" payload="body"
namespace="http://com.myapp.demo/" /> </all> </flow> -->
<flow name="initpayment">
<inbound-endpoint address="http://localhost:8585/services/processpayment">
<cxf:proxy-service wsdlLocation="classpath:processpaymentservice.wsdl"
bindingId="ProcessPaymentServiceServiceSoapBinding" service="ProcessPaymentServiceService"
payload="body" namespace="http://com.myapp.demo/" />
</inbound-endpoint>
<outbound-endpoint address="http://localhost:8081/BillingEntry/services/BillingServicePort">
<!-- <flow-ref name="parallelservices" /> -->
<cxf:proxy-client/>
</outbound-endpoint>
</flow>
</mule>
Process Payment wsdl
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="ProcessPaymentServiceService" targetNamespace="http://processpayment.icp.sf/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://com.myapp.demo/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://processpayment.icp.sf/" schemaLocation="processpaymentservice_schema1.xsd"/>
</schema>
</wsdl:types>
<wsdl:message name="processPayment">
<wsdl:part name="parameters" element="tns:processPayment">
</wsdl:part>
</wsdl:message>
<wsdl:message name="processPaymentResponse">
<wsdl:part name="parameters" element="tns:processPaymentResponse">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="IProcessPayment">
<wsdl:operation name="processPayment">
<wsdl:input name="processPayment" message="tns:processPayment">
</wsdl:input>
<wsdl:output name="processPaymentResponse" message="tns:processPaymentResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ProcessPaymentServiceServiceSoapBinding" type="tns:IProcessPayment">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="processPayment">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="processPayment">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="processPaymentResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ProcessPaymentServiceService">
<wsdl:port name="ProcessPaymentServicePort" binding="tns:ProcessPaymentServiceServiceSoapBinding">
<soap:address location="http://localhost:8081/ProcessPayment/services/ProcessPaymentServicePort"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Billing Service wsdl
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="BillingServiceService" targetNamespace="http://com.myapp.demo2/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://billing.icp.sf/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://billing.icp.sf/" schemaLocation="billingservice_schema1.xsd"/>
</schema>
</wsdl:types>
<wsdl:message name="billingEntryResponse">
<wsdl:part name="parameters" element="tns:billingEntryResponse">
</wsdl:part>
</wsdl:message>
<wsdl:message name="billingEntry">
<wsdl:part name="parameters" element="tns:billingEntry">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="IBillingService">
<wsdl:operation name="billingEntry">
<wsdl:input name="billingEntry" message="tns:billingEntry">
</wsdl:input>
<wsdl:output name="billingEntryResponse" message="tns:billingEntryResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BillingServiceServiceSoapBinding" type="tns:IBillingService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="billingEntry">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="billingEntry">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="billingEntryResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="BillingServiceService">
<wsdl:port name="BillingServicePort" binding="tns:BillingServiceServiceSoapBinding">
<soap:address location="http://localhost:8081/BillingEntry/services/BillingServicePort"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Immediate Problems
I am able to generate the wsdl for ProcessPayment service when I hit the Mule config inbound URL. But it is showing modified values for
<import schemaLocation="".../>
and
<wsdl:port><soap:address>*****</soap:address></wsdl:port>
Using this URL, I am not able to test the service on SOAPui. But when I hit the service original address, and not the Mule inbound address, I get my actual service. It s running in SOAP UI too.
Quick question:
How do I execute a flow? Simply invoking the inbound URL from the browser or SOAPui won't work right?
Here we go, I have created an example that demonstrates how to perform SOAP envelope level manipulations with CXF proxies. From there I'm sure you can expand and build whatever you need.
Please note that:
No code generation is needed, I actually had to remove the classes you've generated otherwise it is not working. This single XML configuration with the WSDLs+XSDs is enough.
I've qualified Mule core elements in order to avoid elements XSL-T generated in the default namespace to end up in Mule core namespace. This is not required if you externalize the XSL fragments.
The (contrived) example exposes processpaymentservice.wsdl. It takes the value of paymentType_req, pretends it's an IP address and uses it to call http://www.webservicex.net/geoipservice.asmx. The geolocated coutry name is then used as the value for the paymentType_res element of the process payment response (the other 2 values are faked).
Tested with soapUI 4.5 and Mule 3.2.1.
Enjoy!
<mule:flow name="processPaymentServiceOrchestration">
<http:inbound-endpoint address="http://localhost:8080/ppso"
exchange-pattern="request-response">
<cxf:proxy-service wsdlLocation="classpath:processpaymentservice.wsdl"
service="ProcessPaymentServiceService" namespace="http://processpayment.icp.sf/" />
</http:inbound-endpoint>
<!-- Transform input of ProcessPayment to input of GetGeoIP -->
<mulexml:xslt-transformer>
<mulexml:xslt-text>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:web="http://www.webservicex.net/">
<xsl:template match="/">
<web:GetGeoIP>
<web:IPAddress><xsl:value-of select="//paymentType_req" /></web:IPAddress>
</web:GetGeoIP>
</xsl:template>
</xsl:stylesheet>
</mulexml:xslt-text>
</mulexml:xslt-transformer>
<mule:message-properties-transformer>
<mule:add-message-property key="SOAPAction" value="http://www.webservicex.net/GetGeoIP" />
</mule:message-properties-transformer>
<http:outbound-endpoint address="http://www.webservicex.net/geoipservice.asmx"
exchange-pattern="request-response">
<cxf:proxy-client soapVersion="1.2" />
</http:outbound-endpoint>
<!-- Transform response of GetGeoIP in response of ProcessPayment -->
<mulexml:xslt-transformer>
<mulexml:xslt-text>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:pp="http://processpayment.icp.sf/" xmlns:web="http://www.webservicex.net/">
<xsl:template match="/">
<pp:return>
<billingID_res>fake billingID_res</billingID_res>
<paymentID_res>fake paymentID_res</paymentID_res>
<paymentType_res><xsl:value-of select="//web:CountryName"/></paymentType_res>
</pp:return>
</xsl:template>
</xsl:stylesheet>
</mulexml:xslt-text>
</mulexml:xslt-transformer>
</mule:flow>