Simple WSDL, getting a ConnectException - eclipse

i really need help with the simpliest things of WSDL.
i got the following WSDL, which is basically just generated code:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="MyFirstWSDL"
targetNamespace="http://www.example.org/MyFirstWSDL/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://www.example.org/MyFirstWSDL/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.example.org/MyFirstWSDL/">
<xsd:element name="getName">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="in" type="xsd:string"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="getNameResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="out" type="xsd:string"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name="getNameRequest">
<wsdl:part name="parameters" element="tns:getName"></wsdl:part>
</wsdl:message>
<wsdl:message name="getNameResponse">
<wsdl:part name="parameters" element="tns:getNameResponse"></wsdl:part>
</wsdl:message>
<wsdl:portType name="MyFirstInterface">
<wsdl:operation name="getName">
<wsdl:input message="tns:getNameRequest"></wsdl:input>
<wsdl:output message="tns:getNameResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="NewBinding" type="tns:MyFirstInterface">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="getName">
<soap:operation
soapAction="http://www.example.org/MyFirstWSDL/getName" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="MyFirstService">
<wsdl:port name="MyFirstPort" binding="tns:NewBinding">
<soap:address location="http://localhost:8197/MyFirstService/" />
</wsdl:port>
</wsdl:service>
Now, when generating a provider and testing the service with the "Web Services Explorer" I keep getting the following exception:
IWAB0135E An unexpected error has occurred.
java.net.ConnectException
Connection refused: connect
So, do you have any clue or suggestions to solve this problem?
thx in advance, matt

Probably because http://localhost:8197/MyFirstService/ is not answering from where you call it.
You can try to check this by telnetting there or simply putting the Address in a browser window.
Though as it is localhost, you should know if you started the server, that is accepting the web service client or not.

Related

What changes should i make in my wsdl file to directly consume in SAP ABAP Proxy?

I have created a soap service using jax-ws in java.I want to consume my WSDL in SAP directly using ABAP proxy. How can i make my WSDL compatible for SAP?
I tried including Max and Min occurrence in my WSDL file. It is working when i test with soap ui. But still getting error in SAP like
SOAP Fault Code:3 One or More Soap header block not understood.
I have searched for this error but couldn't find anything useful.
This is WSDL file which is generated from XSD
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:sch="http://example.com/soap" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://example.com/soap" targetNamespace="http://example.com/soap">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://example.com/soap">
<xs:element name="getOrderRequest">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="1" name="purchaseOrderNumber" type="xs:long"/>
<xs:element maxOccurs="1" minOccurs="1" name="Type" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="1" name="vCode" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="1" name="vName" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="1" name="Location" type="xs:string"/>
<xs:element name="lineItem" type="tns:lineItem"
maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="lineItem">
<xs:sequence>
<xs:element name="Order_No" type="xs:long"/>
<xs:element name="Material" type="xs:string"/>
<xs:element name="Description" type="xs:string"/>
<xs:element name="UOM" type="xs:string"/>
<xs:element name="Value" type="xs:decimal"/>
<xs:element name="Tax" type="xs:string"/>
<xs:element name="Item" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
<xs:element name="getOrderResponse">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="1" name="message" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="getOrderRequest">
<wsdl:part element="tns:getOrderRequest" name="getOrderRequest">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getOrderResponse">
<wsdl:part element="tns:getOrderResponse" name="getOrderResponse">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="OrderService">
<wsdl:operation name="getOrder">
<wsdl:input message="tns:getOrderRequest" name="getOrderRequest">
</wsdl:input>
<wsdl:output message="tns:getOrderResponse" name="getOrderResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="OrderServiceSoap11" type="tns:OrderService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getOrder">
<soap:operation soapAction=""/>
<wsdl:input name="getOrderRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getOrderResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="OrderServiceService">
<wsdl:port binding="tns:OrderServiceSoap11" name="OrderServiceSoap11">
<soap:address location="http://localhost:8089/Soap/app/OrderService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I want to know whether my WSDL file is correct?
Your wsdl policy and service elements are missing. You said that you are getting SOAP header understood error. SOAP header generally used for authentication and generally old SAP version not support authentication in header segment. Change your java code and try with basic authentication.

Mule & Eclipse's WSDL issue

so I have implemented a very simple webservice using eclipse and generated its WSDL using the CXF which is the framework used in Mule as well. However, when I try to publish that same service in Mule using the previously generated WSDL it stops due to something like "BadUsageException: -p invalid character" which is comes from the CXF. I have tried to the java classes from mule using an Axis generated WSDL but no luck with the CXF generated.
Here is my wsdl:
<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://snippet/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" name="SnippetService" targetNamespace="http://snippet/">
<wsdl:types>
<xs:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://snippet/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" elementFormDefault="unqualified" targetNamespace="http://snippet/" version="1.0">
<xs:element name="multiply" type="tns:multiply"/>
<xs:element name="multiplyResponse" type="tns:multiplyResponse"/>
<xs:element name="sum" type="tns:sum"/>
<xs:element name="sumResponse" type="tns:sumResponse"/>
<xs:complexType name="sum">
<xs:sequence>
<xs:element name="arg0" type="xs:int"/>
<xs:element name="arg1" type="xs:int"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="sumResponse">
<xs:sequence>
<xs:element name="return" type="xs:int"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="multiply">
<xs:sequence>
<xs:element name="arg0" type="xs:int"/>
<xs:element name="arg1" type="xs:int"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="multiplyResponse">
<xs:sequence>
<xs:element name="return" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="multiplyResponse">
<wsdl:part element="tns:multiplyResponse" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="sumResponse">
<wsdl:part element="tns:sumResponse" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="sum">
<wsdl:part element="tns:sum" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="multiply">
<wsdl:part element="tns:multiply" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:portType name="InterNya">
<wsdl:operation name="sum">
<wsdl:input message="tns:sum" name="sum"></wsdl:input>
<wsdl:output message="tns:sumResponse" name="sumResponse"></wsdl:output>
</wsdl:operation>
<wsdl:operation name="multiply">
<wsdl:input message="tns:multiply" name="multiply"></wsdl:input>
<wsdl:output message="tns:multiplyResponse" name="multiplyResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="SnippetServiceSoapBinding" type="tns:InterNya">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="sum">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="sum">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="sumResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="multiply">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="multiply">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="multiplyResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="SnippetService">
<wsdl:port binding="tns:SnippetServiceSoapBinding" name="SnippetPort">
<soap:address location="http://localhost:8080/hassib/services/SnippetPort"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Any help would be appreciated. Thanks.
Tested your WSDL with the Anypoint Studio July 2014 Release.
It correctly creates the Web Service classes you expect.
I used JavaSE-1.7 and a 3.5.1 Mule engine.
How I did it:
1. Drag a HTTP endpoint into a new flow
2. Drag a CXF endpoint behind
3. Open CXF properties and create the java classes using "Generate from WSDL" at the Service class property
Cheers,
Patrick

designate a default namespace for an element

I'm building a service to accept the following message. Note how InformationExchangePackage has no namespace prefix, but takes the default xmlns="http://www.something.com/dir/1.0.9". I can not figure out how to create this behavior in the WSDL.
The SOAP request I want to service:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<InformationExchangePackage xmlns:j="http://www.something.gov/dir/3.0.3" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://www.something.com/dir/1.0.9">
<j:OtherInformation>Sometext</OtherInformation>
</InformationExchangePackage>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Following is she SOAP request that soapUI generates. Note the prefix of "loc" on InformationExchangePackage (not what I want).
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:loc="http://localhost/">
<soapenv:Header/>
<soapenv:Body>
<loc:process>
<loc:InformationExchangePackage>
<OtherInformation>?</OtherInformation>
</loc:InformationExchangePackage>
</loc:process>
</soapenv:Body>
</soapenv:Envelope>
My current WSDL:
<?xml version="1.0" encoding="ISO-8859-1"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://localhost/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:cs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://localhost/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<wsdl:types>
<xs:schema targetNamespace="http://localhost/">
<xs:element name="InformationExchangePackage">
<xs:complexType>
<xs:sequence>
<xs:element name="OtherInformation" type="xs:anyType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="processResponseType">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="aCode"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="processRequest">
<wsdl:part name="InformationExchangePackage" element="tns:InformationExchangePackage"/>
</wsdl:message>
<wsdl:message name="processResponse">
<wsdl:part name="processResponse" element="tns:processResponseType"/>
</wsdl:message>
<wsdl:portType name="CCHEndpoint">
<wsdl:operation name="process">
<wsdl:input message="tns:processRequest"/>
<wsdl:output message="tns:processResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="CCHBinding" type="tns:CCHEndpoint">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="process">
<soap:operation soapAction="urn:process" style="rpc"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="CCHEndpointService">
<wsdl:port name="OrderService" binding="tns:CCHBinding">
<!--<soap:address location="http://localhost:8080/wildcat"/>-->
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
If I submit the request with the loc prefix, it works. If I submit the request without the loc prefix, I get:
org.apache.cxf.interceptor.Fault: Message part {http://www.something.com/dir/1.0.9}InformationExchangePackage was not recognized. (Does it exist in service WSDL?)
I imagine I'm missing a parameter in the WSDL. I've taken the following shots in the dark, to no avail:
<xs:element name="InformationExchangePackage" xsi:schemaLocation="http://www.something.com/dir/1.0.9">
<xs:element name="InformationExchangePackage" xsi:noNamespaceSchemaLocation="http://www.something.com/dir/1.0.9">
You don't have any wsdl:message blocks defined.

soapUI - Use WSDL from Websphere Message Broker

I'm doing a project with WebSphere Message Broker which results in 2 BAR files. One the client and the other the server. Both are deployed in a broker in a remote location (a server upstairs). The WSDL that the server flow uses is inside an Message Set Project. Here is the wsdl structure:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.3.1-hudson-749-SNAPSHOT. -->
<definitions targetNamespace="http://ws.interact.bytesw.com/" name="TvPagaInteractWebService" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://ws.interact.bytesw.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<types>
<xsd:schema>
<xsd:import namespace="http://ws.interact.bytesw.com/" schemaLocation="TvPagaInteractWebServiceService.xsd"/>
</xsd:schema>
</types>
<message name="ejecutarTransaccion">
<part name="parameters" element="tns:ejecutarTransaccion"/>
</message>
<message name="ejecutarTransaccionResponse">
<part name="parameters" element="tns:ejecutarTransaccionResponse"/>
</message>
<message name="consultarOperacion">
<part name="parameters" element="tns:consultarOperacion"/>
</message>
<message name="consultarOperacionResponse">
<part name="parameters" element="tns:consultarOperacionResponse"/>
</message>
<message name="consultarServicio">
<part name="parameters" element="tns:consultarServicio"/>
</message>
<message name="consultarServicioResponse">
<part name="parameters" element="tns:consultarServicioResponse"/>
</message>
<portType name="TvPagaInteractWebService">
<operation name="ejecutarTransaccion">
<input message="tns:ejecutarTransaccion"/>
<output message="tns:ejecutarTransaccionResponse"/>
</operation>
<operation name="consultarOperacion">
<input message="tns:consultarOperacion"/>
<output message="tns:consultarOperacionResponse"/>
</operation>
<operation name="consultarServicio">
<input message="tns:consultarServicio"/>
<output message="tns:consultarServicioResponse"/>
</operation>
</portType>
<binding name="TvPagaInteractWebServicePortBinding" type="tns:TvPagaInteractWebService">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="ejecutarTransaccion">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="consultarOperacion">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="consultarServicio">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="TvPagaInteractWebService">
<port name="TvPagaInteractWebServicePort" binding="tns:TvPagaInteractWebServicePortBinding">
<soap:address location="REPLACE_WITH_ACTUAL_URL"/>
</port>
</service>
</definitions>
Once deployed I want to use it from soapUI. But I don't know which endpoint configure it. I've been trying some combinations including the IP and port of the broker connection. But doesn't work, can someone help me, please?
At the bottom of your WSDL you have this
<service name="TvPagaInteractWebService">
<port name="TvPagaInteractWebServicePort" binding="tns:TvPagaInteractWebServicePortBinding">
<soap:address location="REPLACE_WITH_ACTUAL_URL"/>
</port>
</service>
In REPLACE_WITH_ACTUAL_URL goes the address where WMB should bind this particular service so its accesible from the outside
The port which the broker is listening on is a property of the listener. The SOAP nodes use the EG level embedded listener by default so you can find this by executing the command:
mqsireportproperties -e -o HTTPConnector -r
This port can be found in this information but also the current URL registrations are displayed.
The path that the service is bound to is defined by the URL property on the SOAP node itself which you can find from the toolkit.

CXF Web service proxy configuration issues in Mule

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>