Using tHashOutput and tHashInput in Talend esb - esb

I am trying to merge two responses using tHashOutput -> tHashInput, so firstly I am trying to use it for simple, straightforward job and it doesn't work. I send via Soap UI request with ID, then based on this ID retrive name from DB and show it as result. Data are inserted into hashOutput, but aren't there in hashInput.
WSDL:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<wsdl:definitions name="customerSoap"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://www.talend.org/service/"
targetNamespace="http://www.talend.org/service/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://www.talend.org/service/">
<s:element name="getCustomer">
<s:complexType>
<s:sequence>
<s:element name="customerId" type="s:integer"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="getCustomerResponse">
<s:complexType>
<s:sequence>
<s:element name="getCustomerResult" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="getCustomerName">
<s:complexType>
<s:sequence>
<s:element name="customerId" type="s:integer"></s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="getCustomerNameResponse">
<s:complexType>
<s:sequence>
<s:element name="customerNameResult" type="s:string"></s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="getCustomerAddress">
<s:complexType>
<s:sequence>
<s:element name="customerId" type="s:integer"></s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="getCustomerAddressResponse">
<s:complexType>
<s:sequence>
<s:element name="customerAddressResult" type="s:string"></s:element>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="getCustomerRequest">
<wsdl:part element="tns:getCustomer" name="parameters"/>
</wsdl:message>
<wsdl:message name="getCustomerResponse">
<wsdl:part element="tns:getCustomerResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="getCustomerNameRequest">
<wsdl:part name="parameters" element="tns:getCustomerName"></wsdl:part>
</wsdl:message>
<wsdl:message name="getCustomerNameResponse">
<wsdl:part name="parameters" element="tns:getCustomerNameResponse"></wsdl:part>
</wsdl:message>
<wsdl:message name="getCustomerAddressRequest">
<wsdl:part name="parameters" element="tns:getCustomerAddress"></wsdl:part>
</wsdl:message>
<wsdl:message name="getCustomerAddressResponse">
<wsdl:part name="parameters" element="tns:getCustomerAddressResponse"></wsdl:part>
</wsdl:message>
<wsdl:portType name="customerSoap">
<wsdl:operation name="getCustomer">
<wsdl:input message="tns:getCustomerRequest"/>
<wsdl:output message="tns:getCustomerResponse"/>
</wsdl:operation>
<wsdl:operation name="getCustomerName">
<wsdl:input message="tns:getCustomerNameRequest"/>
<wsdl:output message="tns:getCustomerNameResponse"/>
</wsdl:operation>
<wsdl:operation name="getCustomerAddress">
<wsdl:input message="tns:getCustomerAddressRequest"/>
<wsdl:output message="tns:getCustomerAddressResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="customerSoap" type="tns:customerSoap">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="getCustomer">
<soap:operation soapAction="http://www.talend.org/service/getCustomer" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getCustomerName">
<soap:operation soapAction="http://www.talend.org/service/getCustomer" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getCustomerAddress">
<soap:operation soapAction="http://www.talend.org/service/getCustomer" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="airport">
<wsdl:port binding="tns:customerSoap" name="customerSoap">
<soap:address location="http://localhost:8090/esb/customerSoap"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Exception:
Starting job customerSoap_getCustomerName at 10:31 31/03/2016.
[statistics] connecting to socket on port 3524
[statistics] connected
mar 31, 2016 10:31:04 AM org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean buildServiceFromWSDL
INFO: Creating Service {http://www.talend.org/service/}airport from WSDL: C:/Users/VKAROL/Downloads/TESB/Studio/workspace/FINAL10/services/customerSoap_0.1.wsdl
mar 31, 2016 10:31:05 AM org.apache.cxf.endpoint.ServerImpl initDestination
INFO: Setting the server's publish address to be http://localhost:8090/esb/customerSoap
2016-03-31 10:31:05.163:INFO:oejs.Server:jetty-8.1.14.v20131031
2016-03-31 10:31:05.221:INFO:oejs.AbstractConnector:Started SelectChannelConnector#localhost:8090
web service [endpoint: http://localhost:8090/esb/customerSoap] published
mar 31, 2016 10:31:08 AM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
WARNING: Interceptor for {http://www.talend.org/service/}airport#{http://www.talend.org/service/}getCustomerName has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not generate the XML stream caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
at [row,col {unknown-source}]: [2,0].
at org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:94)
at org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:54)
at org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:48)
at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:136)
at org.apache.cxf.wsdl.interceptors.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:83)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251)
at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:234)
at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1088)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1024)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:370)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Unknown Source)
Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
at [row,col {unknown-source}]: [2,0]
at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:685)
at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2141)
at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2047)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1131)
at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:771)
at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:701)
at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:625)
at org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:91)
... 28 more
Here is how my job looks like:
My tXMLMap:
Thank you for help.

Answer from Shong from Talend Team on official forum:
Hi
I think this is because 'keep listening' box is checked on tESBRequestProvider, tHashInput linked with onsubjobOK will never work. To resolve it, change the job design to:
tESBRequestProvider.....tHashOutput--oncomponentok-tHashInput--main--tESBResponseProvider
Regards
Shong

Related

IBM integration bus: A SOAP request received an HTTP Error Status Code '500'

I'm new to Ibm Integration Bus, and I've been struggling to convert Data from http nodes to SOAP nodes.
My message Flow
The problem is when I use SOAP input it works but when I change it with Http input and convert the data from JSON to XML, an error keeps showing up.
code of compute node:
DECLARE reftoOut REFERENCE To OutputRoot.XMLNSC.ns2:MessageExtraitRequest;
DECLARE reftoIn REFERENCE To InputRoot.JSON.Data;
SET reftoOut.ns2:No_du_compte = reftoIn.No_du_compte;
SET reftoOut.ns2:Date_operation = reftoIn.Date_operation;
SET reftoOut.ns2:REFERENCE = reftoIn.REFERENCE;
SET reftoOut.ns2:Libelle = reftoIn.Libelle;
SET reftoOut.ns2:Date_valeur = reftoIn.Date_valeur;
SET reftoOut.ns2:DEBIT = reftoIn.DEBIT;
SET reftoOut.ns2:CREDIT = reftoIn.CREDIT;
my WSDL ( it works just fine with SOAPInput and postman)
<?xml version="1.1" encoding="UTF-8"?> <!-- <definitions> must be the root of the WSDL document --> <wsdl:definitions targetNamespace="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <!-- WSDL TYPES: definition of the data types that are used in the web service --> <wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<s:element name="MessageExtraitRequest">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="No_du_compte" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="Date_operation" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="REFERENCE" type="s:int"/>
<s:element minOccurs="1" maxOccurs="1" name="Libelle" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="Date_valeur" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="DEBIT" type="s:int"/>
<s:element minOccurs="1" maxOccurs="1" name="CREDIT" type="s:int"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="MessageExtraitResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="fieldCount" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="affectedRows" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="insertId" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="serverStatus" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="warningCount" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="message" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="protocol41" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="changedRows" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
</s:schema> </wsdl:types> <!-- MESSAGES: defines the data being exchanged between the service and client --> <wsdl:message name="MessageExtraitSoapIn">
<wsdl:part name="parameters" element="tns:MessageExtraitRequest"/> </wsdl:message> <wsdl:message name="MessageExtraitSoapOut">
<wsdl:part name="parameters" element="tns:MessageExtraitResponse"/> </wsdl:message> <!-- PORT TYPES: defines the complete communication operation (one way/round trip) --> <wsdl:portType name="MessageExtraitSoapPort">
<!-- The operation name must be the same as the one specified in the service object -->
<wsdl:operation name="MessageExtrait">
<wsdl:input message="tns:MessageExtraitSoapIn"/>
<wsdl:output message="tns:MessageExtraitSoapOut"/>
</wsdl:operation> </wsdl:portType> <!-- BINDING: provides details on how a portType operation will actually be transmitted --> <wsdl:binding name="MessageExtraitServiceSoapBinding" type="tns:MessageExtraitSoapPort">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="MessageExtrait">
<soap:operation soapAction="MessageExtrait" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation> </wsdl:binding>
<!-- SERVICE: --> <wsdl:service name="MessageExtraitService">
<wsdl:port name="MessageExtraitServiceSoapPort" binding="tns:MessageExtraitServiceSoapBinding">
<soap:address location="http://localhost:8000/wsdl"/>
</wsdl:port> </wsdl:service> </wsdl:definitions>
The error:
Error sending request to http "http://localhost:7800/server"
java.io.IOException: {"error": {"code":500,"status":"Internal Server Error","detail":"BIP2230E: Error detected whilst processing a message in node 'WS_MF.
SOAP Request'. \nBIP3754E: The SOAP Request Node or SOAP Async Request Node WS_MF.
SOAP Request encountered an error while processing the outbound SOAP request. \nBIP3162S: An HTTP error occurred.
The HTTP Request-Line was: ''POST /wsdl HTTP/1.1
\nBIP3711E: A SOAP request received an HTTP Error Status Code '500', but the response message body was not a SOAP fault.
The HTTP request was made to the destination ''http://localhost:8000/wsdl''.
The HTTP status line that was returned was: ''HTTP/1.1 500 Internal Server Error''. \nBIP3701E: A Java exception was thrown whilst calling the Java JNI method ''Axis2Requester_processResponseMessageSync''.
The Java exception was ''org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: An invalid XML character (Unicode: 0x45) was found in the prolog of the document.''.
The Java stack trace was ''Frame : 0 org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: An invalid XML character (Unicode: 0x45) was found in the prolog of the document.
| #: org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:293)|
#: org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:204)
| #: org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:154)
| #: org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:140)
| #: com.ibm.broker.axis2.SoapUtilities.createSOAPMessage(SoapUtilities.java:2259)
| #: com.ibm.broker.axis2.SoapUtilities.createSOAPMessage(SoapUtilities.java:1959)
| #: com.ibm.broker.axis2.Axis2Requester.processResponseMessageSync(Axis2Requester.java:2184)|Frame : 1 javax.xml.stream.XMLStreamException: An invalid XML character (Unicode: 0x45) was found in the prolog of the document.
| #: com.ibm.xml.xlxp2.api.stax.msg.StAXMessageProvider.throwWrappedXMLStreamException(StAXMessageProvider.java:76)
| #: com.ibm.xml.xlxp2.api.stax.XMLStreamReaderImpl.produceFatalErrorEvent(XMLStreamReaderImpl.java:2008)
| #: com.ibm.xml.xlxp2.api.jaxb.JAXBXMLStreamReader.produceFatalErrorEvent(JAXBXMLStreamReader.java:356)| #: com.ibm.xml.xlxp2.scan.DocumentScanner.reportFatalError(DocumentScanner.java:4871)| #: com.ibm.xml.xlxp2.scan.DocumentScanner.reportFatalError(DocumentScanner.java:1212)| #: com.ibm.xml.xlxp2.scan.DocumentScanner.scanProlog(DocumentScanner.java:1777)| #: com.ibm.xml.xlxp2.scan.DocumentScanner.nextEvent(DocumentScanner.java:1323)| #: com.ibm.xml.xlxp2.api.stax.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:581)| #: com.ibm.xml.xlxp2.api.stax.XMLInputFactoryImpl$XMLStreamReaderProxyImpl.next(XMLInputFactoryImpl.java:183)| #: com.ibm.xml.xlxp2.api.wssec.WSSXMLInputFactory$WSSStreamReaderProxy.next(WSSXMLInputFactory.java:55)| #: org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:672)| #: org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
| #: org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:204)
| #: org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:154)
| #: org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:140)
| #: com.ibm.broker.axis2.SoapUtilities.createSOAPMessage(SoapUtilities.java:2259)
| #: com.ibm.broker.axis2.SoapUtilities.createSOAPMessage(SoapUtilities.java:1959)
| #: com.ibm.broker.axis2.Axis2Requester.processResponseMessageSync(Axis2Requester.java:2184)''. "}}
at com.ibm.etools.mft.unittest.core.transport.http.HttpClient.makeHttpCall(HttpClient.java:163)
at com.ibm.etools.mft.unittest.core.transport.http.HttpClient.makeSOAPRequest(HttpClient.java:99)
at com.ibm.etools.mft.unittest.core.transport.http.SendHTTPMessageDelegate.sendBytes(SendHTTPMessageDelegate.java:125)
at com.ibm.etools.mft.unittest.core.commchannel.mb.AbstractSendMessageDelegate.sendPlainText(AbstractSendMessageDelegate.java:255)
at com.ibm.etools.mft.unittest.core.commchannel.mb.AbstractSendMessageDelegate.sendMessage(AbstractSendMessageDelegate.java:208)
at com.ibm.etools.mft.unittest.core.transport.http.HTTPHandler.send(HTTPHandler.java:53)
at com.ibm.etools.mft.unittest.core.commchannel.mb.SendMessageOperation.sendMessage(SendMessageOperation.java:87)
at com.ibm.etools.mft.unittest.core.commchannel.jobs.SendMessageOperationJob.doRun(SendMessageOperationJob.java:94)
at com.ibm.etools.mft.unittest.core.commchannel.jobs.SendMessageOperationJob.run(SendMessageOperationJob.java:149)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
The important bits of the error message are:
BIP3754E: The SOAP Request Node or SOAP Async Request Node WS_MF
encountered an error while processing the outbound SOAP request.
BIP3711E: A SOAP request received an HTTP Error Status Code '500',
but the response message body was not a SOAP fault.
In other words: The reply of endpoint http://localhost:8000/wsdl is not valid SOAP reply; maybe it is plain text. You should analyse this endpoint and figure out why it is not replying a proper SOAP reply.

Mule Web Service Consumer not adding SOAP wrapper properly

I'm trying to set up a flow that involves taking in a JSON payload through an HTTP endpoint, transforming it into an XML payload to be used for a SOAP transaction, then turned back into a JSON payload, much like in this demo here: https://www.youtube.com/watch?v=XyZcI1_MbOo.
Now, I'm setting up the flow, and have the Web Service Consumer component up and running. Trying to debug the flow, I'm simply doing the first transformation to XML, sending the message to the Web Service Consumer, and then writing the resultant message to a file. My flow is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata" xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" xmlns:ws="http://www.mulesoft.org/schema/mule/ws" xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:wmq="http://www.mulesoft.org/schema/mule/ee/wmq" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.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/ee/wmq http://www.mulesoft.org/schema/mule/ee/wmq/current/mule-wmq-ee.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/ws http://www.mulesoft.org/schema/mule/ws/current/mule-ws.xsd
http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd
http://www.example.org/Transactions/">
<http:listener-config name="HTTP_Listener_Configuration" host="10.14.5.211" port="8081" doc:name="HTTP Listener Configuration"/>
<ws:consumer-config name="Web_Service_Consumer" wsdlLocation="Transactions.wsdl" service="Transactions" port="TransactionsSOAP" serviceAddress="http://www.example.org/Transactions/" doc:name="Web Service Consumer"/>
<flow name="soapboxFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="*" doc:name="HTTP"/>
<dw:transform-message doc:name="Transform Message" metadata:id="1639d844-c95e-4feb-bda5-6258ec392591">
<dw:set-payload><![CDATA[%dw 1.0
%output application/xml
%namespace ns0 http://www.example.org/Transactions/
---
{
ns0#makePayment: {
cId: payload.payments.account_no,
noTrans: 1,
payList: {
(payload.payments map ((payment , indexOfPayment) -> {
pay: {
aNum: payment.account_no,
aName: payment.account_no,
am: payment.amount,
ref: payment.description,
des: payment.description,
qu: payment.quantity
}
}))
}
}
}]]></dw:set-payload>
</dw:transform-message>
<ws:consumer config-ref="Web_Service_Consumer" doc:name="Web Service Consumer" operation="makePayment"/>
</flow>
</mule>
(sorry for all the spacing in the DW component). The associated WSDL looks like this:
<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="Transactions" targetNamespace="http://www.example.org/Transactions/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.example.org/Transactions/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:documentation>
<wsdl:appinfo source="WMQI_APPINFO">
<MRWSDLAppInfo imported="true">
<binding hasEncoding="false" imported="true" name="TransactionsSOAP" originalBindingStyle="document"/>
</MRWSDLAppInfo>
</wsdl:appinfo>
</wsdl:documentation>
<wsdl:types>
<xsd:schema targetNamespace="http://www.example.org/Transactions/" xmlns:testSchExtn="http://www.test.com/schema/extensions/">
<xsd:include schemaLocation="Transactions_InlineSchema1.xsd"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="retrieveTransactionsRequest">
<wsdl:part element="tns:transactionRequest" name="transactionRequest"/>
</wsdl:message>
<wsdl:message name="retrieveTransactionsResponse">
<wsdl:part element="tns:transactionResponse" name="transactionResponse"/>
</wsdl:message>
<wsdl:message name="makePaymentRequest">
<wsdl:part element="tns:makePayment" name="paymentRequest"/>
</wsdl:message>
<wsdl:message name="makePaymentResponse">
<wsdl:part element="tns:makePaymentResponse" name="paymentResponse"/>
</wsdl:message>
<wsdl:portType name="Transactions">
<wsdl:operation name="retrieveTransactions">
<wsdl:input message="tns:retrieveTransactionsRequest"/>
<wsdl:output message="tns:retrieveTransactionsResponse"/>
</wsdl:operation>
<wsdl:operation name="makePayment">
<wsdl:input message="tns:makePaymentRequest"/>
<wsdl:output message="tns:makePaymentResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="TransactionsSOAP" type="tns:Transactions">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="retrieveTransactions">
<soap:operation soapAction="http://www.example.org/Transactions/retrieveTransactions"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="makePayment">
<soap:operation soapAction="http://www.example.org/Transactions/makePayment"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Transactions">
<wsdl:port binding="tns:TransactionsSOAP" name="TransactionsSOAP">
<soap:address location="www.example.com"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Finally, when I input my sample JSON file into the flow, and look at the output result, I get this file:
Response was of unexpected text/html ContentType. Incoming portion of HTML stream: <?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>404 - Not Found</title>
</head>
<body>
<h1>404 - Not Found</h1>
<script type="text/javascript" src="http://gp1.wpc.edgecastcdn.net/00222B/jtest/tpbeacontest.js"></script>
</body>
</html>
. Failed to route event via endpoint: org.mule.module.cxf.CxfOutboundMessageProcessor. Message payload is of type: PushbackInputStream
So clearly, something is getting mucked up -- I don't know why the content type in the resultant file was of text/html, as I certainly didn't configure it that way. Any suggestions as to where I've gone wrong?
Your config not readable but my guess is that you don't have an endpoint after cxf component (outbound-endpoint) see below as its needed.
<mule ...>
................ initial flow
<cxf:jaxws-client operation="yourOperation" clientClass="com.abc.ws.endpoints.XYZService" port="port" enableMuleSoapHeaders="true" doc:name="docName">
<cxf:jaxb-databinding/>
</cxf:jaxws-client>
<outbound-endpoint address="http://localhost:8080/my/url/enpoint" doc:name="documentName" exchange-pattern="request-response"/>**
<echo-component doc:name="Echo"/>
</flow>
</mule>
You received a 404 looks like the service is not available from Mule.
Are you behind a proxy or firewall, are you able to call this operation from another tool as SOAP UI?
I've taken a look at the WSDL and Mule configuration provided and can see that you have configured your web service location at http://www.example.org/Transactions/ but it doesn't look like there's a web service there. Unless your positive this should work, I'd say that's the case.
If you want to try a Web Service that's public and responsive check out http://www.webservicex.net/globalweather.asmx?WSDL
For future reference, it's advisable to enable wire logging to see what's going on when troubleshooting this issues. Just add the following o the log4j2.xml file
<AsyncLogger name="org.mule.module.http.internal.HttpMessageLogger" level="DEBUG" />
<AsyncLogger name="com.ning.http" level="DEBUG" />

SOAP parameters passed to Nav 2013 R2 cause error as if they are null

I`m trying to call a Nav 2013 R2 web service codeunit with a custom SOAP command and I get a response indicating that the parameters being passed are null, which they are not.
Does anyone have an answer as to why this is happening or could point me in a direction that could help solve this? Thanks!
Here is the SOAP request:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><TransferOrderCreate xmlns="urn:microsoft-dynamics-schemas/Codeunit/WebTestCodeunit"><ptext>this is some text</ptext><pint>999</pint></TransferOrderCreate></soap:Body></soap:Envelope>
Here is the SOAP response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode xmlns:a="urn:microsoft-dynamics-schemas/error">a:Microsoft.Dynamics.Nav.Service.WebMetadata.ServiceBrokerException</faultcode><faultstring xml:lang="en-CA">Parameter ptext in method TransferOrderCreate in service WebTestCodeunit is null! </faultstring><detail><string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">Parameter ptext in method TransferOrderCreate in service WebTestCodeunit is null! </string></detail></s:Fault></s:Body></s:Envelope>
Here is the service as exposed by Nav:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="urn:microsoft-dynamics-schemas/codeunit/WebTestCodeunit" targetNamespace="urn:microsoft-dynamics-schemas/codeunit/WebTestCodeunit" debug="true">
<script id="FirebugLite" firebugIgnore="true" extension="Chrome"/>
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:microsoft-dynamics-schemas/codeunit/WebTestCodeunit">
<element name="TransferOrderCreate">
<complexType>
<sequence>
<element minOccurs="1" maxOccurs="1" name="ptext" type="string"/>
<element minOccurs="1" maxOccurs="1" name="pint" type="int"/>
</sequence>
</complexType>
</element>
<element name="TransferOrderCreate_Result">
<complexType>
<sequence>
<element minOccurs="1" maxOccurs="1" name="return_value" type="string"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<message name="TransferOrderCreate">
<part name="parameters" element="tns:TransferOrderCreate"/>
</message>
<message name="TransferOrderCreate_Result">
<part name="parameters" element="tns:TransferOrderCreate_Result"/>
</message>
<portType name="WebTestCodeunit_Port">
<operation name="TransferOrderCreate">
<input name="TransferOrderCreate" message="tns:TransferOrderCreate"/>
<output name="TransferOrderCreate_Result" message="tns:TransferOrderCreate_Result"/>
</operation>
</portType>
<binding name="WebTestCodeunit_Binding" type="tns:WebTestCodeunit_Port">
<binding xmlns="http://schemas.xmlsoap.org/wsdl/soap/" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="TransferOrderCreate">
<operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/" soapAction="urn:microsoft-dynamics-schemas/codeunit/WebTestCodeunit:TransferOrderCreate" style="document"/>
<input name="TransferOrderCreate">
<body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
</input>
<output name="TransferOrderCreate_Result">
<body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
</output>
</operation>
</binding>
<service name="WebTestCodeunit">
<port name="WebTestCodeunit_Port" binding="tns:WebTestCodeunit_Binding">
<address xmlns="http://schemas.xmlsoap.org/wsdl/soap/" location="http://lt0619.xx.xxxxxxxxx.xx:11047/Trunk/WS/7002/Codeunit/WebTestCodeunit"/>
</port>
</service>
</definitions>
Check namespaces in wsdl definition and your request. Namespaces are case sensitive.
wsdl:
urn:microsoft-dynamics-schemas/codeunit/WebTestCodeunit
reqest:
urn:microsoft-dynamics-schemas/Codeunit/WebTestCodeunit
This could throw the exception you see.

How to merge two wsdl in a wsdl file?

I created a proxy in WSO2 ESB, and used two different endpoints in it. Then I want to publish a common wsdl. I have two wsdl adresses from two different web services.
1- http://localhost:12080/SRV-CSB-MOCK/CsbService?wsdl
<?xml version="1.0" ?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://csb.sgrs.ayesas.com/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="CsbService" targetNamespace="http://csb.sgrs.ayesas.com/">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://csb.sgrs.ayesas.com/" elementFormDefault="unqualified" targetNamespace="http://csb.sgrs.ayesas.com/" version="1.0">
<xs:element name="carpma" type="tns:carpma"></xs:element>
<xs:element name="carpmaResponse" type="tns:carpmaResponse"></xs:element>
<xs:complexType name="carpma">
<xs:sequence>
<xs:element name="ilk" type="xs:int"></xs:element>
<xs:element name="son" type="xs:int"></xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="carpmaResponse">
<xs:sequence>
<xs:element name="return" type="xs:int"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="carpma">
<wsdl:part element="tns:carpma" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="carpmaResponse">
<wsdl:part element="tns:carpmaResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="CsbService">
<wsdl:operation name="carpma">
<wsdl:input message="tns:carpma" name="carpma">
</wsdl:input>
<wsdl:output message="tns:carpmaResponse" name="carpmaResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="CsbServiceSoapBinding" type="tns:CsbService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"></soap:binding>
<wsdl:operation name="carpma">
<soap:operation soapAction="carpma" style="document"></soap:operation>
<wsdl:input name="carpma">
<soap:body use="literal"></soap:body>
</wsdl:input>
<wsdl:output name="carpmaResponse">
<soap:body use="literal"></soap:body>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="CsbService">
<wsdl:port binding="tns:CsbServiceSoapBinding" name="CsbServicePort">
<soap:address location="http://localhost:12080/SRV-CSB-MOCK/CsbService"></soap:address>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
2- http://localhost:12080/SRV_DBS_MOCK/MockGTHBService/MockGTHBService?wsdl
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:tns="http://gthb.dbs.ayesas.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://gthb.dbs.ayesas.com/">
<wsdl:types>
<xsd:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://gthb.dbs.ayesas.com/" version="1.0">
<xsd:element name="add" type="tns:add"></xsd:element>
<xsd:element name="addResponse" type="tns:addResponse"></xsd:element>
<xsd:complexType name="add">
<xsd:sequence>
<xsd:element name="x" type="xsd:int"></xsd:element>
<xsd:element name="y" type="xsd:int"></xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="addResponse">
<xsd:sequence>
<xsd:element name="return" type="xsd:int"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="add">
<wsdl:part name="parameters" element="tns:add"></wsdl:part>
</wsdl:message>
<wsdl:message name="addResponse">
<wsdl:part name="parameters" element="tns:addResponse"></wsdl:part>
</wsdl:message>
<wsdl:portType name="GTHBProxyPortType">
<wsdl:operation name="add">
<wsdl:input message="tns:add" wsaw:Action="add"></wsdl:input>
<wsdl:output message="tns:addResponse" wsaw:Action="http://gthb.dbs.ayesas.com/MockGTHBService/addResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="GTHBProxySoap11Binding" type="tns:GTHBProxyPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"></soap:binding>
<wsdl:operation name="add">
<soap:operation soapAction="add" style="document"></soap:operation>
<wsdl:input>
<soap:body use="literal"></soap:body>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"></soap:body>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="GTHBProxySoap12Binding" type="tns:GTHBProxyPortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"></soap12:binding>
<wsdl:operation name="add">
<soap12:operation soapAction="add" style="document"></soap12:operation>
<wsdl:input>
<soap12:body use="literal"></soap12:body>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"></soap12:body>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="GTHBProxyHttpBinding" type="tns:GTHBProxyPortType">
<http:binding verb="POST"></http:binding>
<wsdl:operation name="add">
<http:operation location="add"></http:operation>
<wsdl:input>
<mime:content type="text/xml" part="parameters"></mime:content>
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="parameters"></mime:content>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="GTHBProxy">
<wsdl:port name="GTHBProxyHttpSoap11Endpoint" binding="tns:GTHBProxySoap11Binding">
<soap:address location="http://localhost.localdomain:8280/services/GTHBProxy.GTHBProxyHttpSoap11Endpoint"></soap:address>
</wsdl:port>
<wsdl:port name="GTHBProxyHttpsSoap11Endpoint" binding="tns:GTHBProxySoap11Binding">
<soap:address location="https://localhost.localdomain:8243/services/GTHBProxy.GTHBProxyHttpsSoap11Endpoint"></soap:address>
</wsdl:port>
<wsdl:port name="GTHBProxyHttpsSoap12Endpoint" binding="tns:GTHBProxySoap12Binding">
<soap12:address location="https://localhost.localdomain:8243/services/GTHBProxy.GTHBProxyHttpsSoap12Endpoint"></soap12:address>
</wsdl:port>
<wsdl:port name="GTHBProxyHttpSoap12Endpoint" binding="tns:GTHBProxySoap12Binding">
<soap12:address location="http://localhost.localdomain:8280/services/GTHBProxy.GTHBProxyHttpSoap12Endpoint"></soap12:address>
</wsdl:port>
<wsdl:port name="GTHBProxyHttpsEndpoint" binding="tns:GTHBProxyHttpBinding">
<http:address location="https://localhost.localdomain:8243/services/GTHBProxy.GTHBProxyHttpsEndpoint"></http:address>
</wsdl:port>
<wsdl:port name="GTHBProxyHttpEndpoint" binding="tns:GTHBProxyHttpBinding">
<http:address location="http://localhost.localdomain:8280/services/GTHBProxy.GTHBProxyHttpEndpoint"></http:address>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I want to merge them in a wsdl file. I added the schemas and methods of second wsdl to first wsdl. But I cannot change targetNamespace="http://csb.sgrs.ayesas.com/" in definitions. So I can't access another methods in second wsdl.
Here is a similar questions on StackOverflow that might be of assistance:
Multiple wsdl and xsd files... into a single wsdl
With WsO2 At times it's easier to have two separate endpoints and then create a service that will call both of them and then blend the two results together using an XSLT transformation, or whatever the correct action is for your business use case.
But when you need to have one service that calls two different endpoints, you have the option of creating a WSDL that represents both endpoints by creating a namespace that can work for both.
If you are manually creating a WSDL consider these points:
Ensure that the target namespace of the two WSDL files is the same. If it is not, you will need to update the namespace in one of the files to match the other. IE: Both calls need to have a unique name.
Check for any duplicate element or type definitions in the two WSDL files and remove them.
Check for any naming conflicts between elements, types, and operations in the two WSDL files and resolve them.
Ensure that all imported and included files in the two WSDL files are also merged and their references are updated accordingly.
Validate the merged WSDL file to ensure that it is syntactically and semantically correct.
Test the merged WSDL file with a SOAP client to ensure that it works as expected.

Exception classes generated using Axis2 wsdl2java don't extend Exception

I'm trying to generate a client using wsdl2java. The wsdl is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://admin.ws.csd.rsa.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://admin.ws.csd.rsa.com" xmlns:intf="http://admin.ws.csd.rsa.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 created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->
<wsdl:types>
<schema elementFormDefault="qualified" targetNamespace="http://admin.ws.csd.rsa.com" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="getUserStatus">
<complexType>
<sequence>
<element name="in0" type="impl:AdminRequest"/>
</sequence>
</complexType>
</element>
<complexType name="GenericRequest">
<sequence>
<element name="adminID" nillable="true" type="xsd:string"/>
<element name="orgName" nillable="true" type="xsd:string"/>
<element name="userName" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="AdminRequest">
<complexContent>
<extension base="impl:GenericRequest">
<sequence>
<element name="userStatus" nillable="true" type="xsd:string"/>
</sequence>
</extension>
</complexContent>
</complexType>
<element name="getUserStatusResponse">
<complexType>
<sequence>
<element name="getUserStatusReturn" type="impl:AdminResponse"/>
</sequence>
</complexType>
</element>
<complexType name="GenericResponse">
<sequence>
<element name="status" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="UserChange">
<sequence>
<element name="date" nillable="true" type="xsd:string"/>
<element name="description" nillable="true" type="xsd:string"/>
<element name="type" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ArrayOfUserChange">
<sequence>
<element maxOccurs="unbounded" minOccurs="0" name="userChangeHistory" type="impl:UserChange"/>
</sequence>
</complexType>
<complexType name="AdminResponse">
<complexContent>
<extension base="impl:GenericResponse">
<sequence>
<element name="userChangeHistory" nillable="true" type="impl:ArrayOfUserChange"/>
<element name="userStatus" nillable="true" type="xsd:string"/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType name="AdminServiceException">
<sequence/>
</complexType>
<element name="fault" type="impl:AdminServiceException"/>
<element name="unlockUser">
<complexType>
<sequence>
<element name="in0" type="impl:AdminRequest"/>
</sequence>
</complexType>
</element>
<element name="unlockUserResponse">
<complexType>
<sequence>
<element name="unlockUserReturn" type="impl:AdminResponse"/>
</sequence>
</complexType>
</element>
<element name="deleteUser">
<complexType>
<sequence>
<element name="in0" type="impl:AdminRequest"/>
</sequence>
</complexType>
</element>
<element name="deleteUserResponse">
<complexType>
<sequence>
<element name="deleteUserReturn" type="impl:AdminResponse"/>
</sequence>
</complexType>
</element>
<element name="getUserChangeHistory">
<complexType>
<sequence>
<element name="in0" type="impl:AdminRequest"/>
</sequence>
</complexType>
</element>
<element name="getUserChangeHistoryResponse">
<complexType>
<sequence>
<element name="getUserChangeHistoryReturn" type="impl:AdminResponse"/>
</sequence>
</complexType>
</element>
<element name="lockUser">
<complexType>
<sequence>
<element name="in0" type="impl:AdminRequest"/>
</sequence>
</complexType>
</element>
<element name="lockUserResponse">
<complexType>
<sequence>
<element name="lockUserReturn" type="impl:AdminResponse"/>
</sequence>
</complexType>
</element>
<element name="setUserStatus">
<complexType>
<sequence>
<element name="in0" type="impl:AdminRequest"/>
</sequence>
</complexType>
</element>
<element name="setUserStatusResponse">
<complexType>
<sequence>
<element name="setUserStatusReturn" type="impl:AdminResponse"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="lockUserRequest">
<wsdl:part element="impl:lockUser" name="parameters"/>
</wsdl:message>
<wsdl:message name="unlockUserRequest">
<wsdl:part element="impl:unlockUser" name="parameters"/>
</wsdl:message>
<wsdl:message name="setUserStatusRequest">
<wsdl:part element="impl:setUserStatus" name="parameters"/>
</wsdl:message>
<wsdl:message name="getUserStatusResponse">
<wsdl:part element="impl:getUserStatusResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="getUserStatusRequest">
<wsdl:part element="impl:getUserStatus" name="parameters"/>
</wsdl:message>
<wsdl:message name="getUserChangeHistoryResponse">
<wsdl:part element="impl:getUserChangeHistoryResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="getUserChangeHistoryRequest">
<wsdl:part element="impl:getUserChangeHistory" name="parameters"/>
</wsdl:message>
<wsdl:message name="AdminServiceException">
<wsdl:part element="impl:fault" name="fault"/>
</wsdl:message>
<wsdl:message name="lockUserResponse">
<wsdl:part element="impl:lockUserResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="deleteUserRequest">
<wsdl:part element="impl:deleteUser" name="parameters"/>
</wsdl:message>
<wsdl:message name="deleteUserResponse">
<wsdl:part element="impl:deleteUserResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="unlockUserResponse">
<wsdl:part element="impl:unlockUserResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="setUserStatusResponse">
<wsdl:part element="impl:setUserStatusResponse" name="parameters"/>
</wsdl:message>
<wsdl:portType name="UserAdminService">
<wsdl:operation name="getUserStatus">
<wsdl:input message="impl:getUserStatusRequest" name="getUserStatusRequest"/>
<wsdl:output message="impl:getUserStatusResponse" name="getUserStatusResponse"/>
<wsdl:fault message="impl:AdminServiceException" name="AdminServiceException"/>
</wsdl:operation>
<wsdl:operation name="unlockUser">
<wsdl:input message="impl:unlockUserRequest" name="unlockUserRequest"/>
<wsdl:output message="impl:unlockUserResponse" name="unlockUserResponse"/>
<wsdl:fault message="impl:AdminServiceException" name="AdminServiceException"/>
</wsdl:operation>
<wsdl:operation name="deleteUser">
<wsdl:input message="impl:deleteUserRequest" name="deleteUserRequest"/>
<wsdl:output message="impl:deleteUserResponse" name="deleteUserResponse"/>
<wsdl:fault message="impl:AdminServiceException" name="AdminServiceException"/>
</wsdl:operation>
<wsdl:operation name="getUserChangeHistory">
<wsdl:input message="impl:getUserChangeHistoryRequest" name="getUserChangeHistoryRequest"/>
<wsdl:output message="impl:getUserChangeHistoryResponse" name="getUserChangeHistoryResponse"/>
<wsdl:fault message="impl:AdminServiceException" name="AdminServiceException"/>
</wsdl:operation>
<wsdl:operation name="lockUser">
<wsdl:input message="impl:lockUserRequest" name="lockUserRequest"/>
<wsdl:output message="impl:lockUserResponse" name="lockUserResponse"/>
<wsdl:fault message="impl:AdminServiceException" name="AdminServiceException"/>
</wsdl:operation>
<wsdl:operation name="setUserStatus">
<wsdl:input message="impl:setUserStatusRequest" name="setUserStatusRequest"/>
<wsdl:output message="impl:setUserStatusResponse" name="setUserStatusResponse"/>
<wsdl:fault message="impl:AdminServiceException" name="AdminServiceException"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="AdaptiveAuthenticationAdminSoapBinding" type="impl:UserAdminService">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getUserStatus">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getUserStatusRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getUserStatusResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="AdminServiceException">
<wsdlsoap:fault name="AdminServiceException" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="unlockUser">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="unlockUserRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="unlockUserResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="AdminServiceException">
<wsdlsoap:fault name="AdminServiceException" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="deleteUser">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="deleteUserRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="deleteUserResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="AdminServiceException">
<wsdlsoap:fault name="AdminServiceException" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="getUserChangeHistory">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getUserChangeHistoryRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getUserChangeHistoryResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="AdminServiceException">
<wsdlsoap:fault name="AdminServiceException" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="lockUser">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="lockUserRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="lockUserResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="AdminServiceException">
<wsdlsoap:fault name="AdminServiceException" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="setUserStatus">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="setUserStatusRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="setUserStatusResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="AdminServiceException">
<wsdlsoap:fault name="AdminServiceException" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="UserAdminServiceService">
<wsdl:port binding="impl:AdaptiveAuthenticationAdminSoapBinding" name="AdaptiveAuthenticationAdmin">
<wsdlsoap:address location="http://myserver:83/AdaptiveAuthenticationAdmin/services/AdaptiveAuthenticationAdmin"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
The issue I'm finding if that want to unpack the classes (using option -u), the class AdminServiceException does not extend java.lang.Exception, and therefore the code doesn't compile, since that it can not throw that class. So the situation is like this:
If I pack the classes(no option -u), the class is defined as follows:
public class AdminServiceException extends java.lang.Exception{....}
but if I use option -u, the class is generated as follows:
public class AdminServiceException
implements org.apache.axis2.databinding.ADBBean{....}
which is not correct, since it can not be thrown. Any ideas?
EDIT:
I just modified the WSDL to make it simplier. It's as follows:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://admin.ws.csd.rsa.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://admin.ws.csd.rsa.com" xmlns:intf="http://admin.ws.csd.rsa.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 created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->
<wsdl:types>
<schema elementFormDefault="qualified" targetNamespace="http://admin.ws.csd.rsa.com" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="myRequest">
<complexType>
<sequence>
<element name="userName" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="myResponse">
<complexType>
<sequence>
<element name="userStatus" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
</element>
<complexType name="AdminServiceException">
<sequence/>
</complexType>
<element name="fault" type="impl:AdminServiceException"/>
</schema>
</wsdl:types>
<wsdl:message name="getUserStatusResponse">
<wsdl:part element="impl:myResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="getUserStatusRequest">
<wsdl:part element="impl:myRequest" name="parameters"/>
</wsdl:message>
<wsdl:message name="AdminServiceException">
<wsdl:part element="impl:fault" name="fault"/>
</wsdl:message>
<wsdl:portType name="UserAdminService">
<wsdl:operation name="getUserStatus">
<wsdl:input message="impl:getUserStatusRequest" name="getUserStatusRequest"/>
<wsdl:output message="impl:getUserStatusResponse" name="getUserStatusResponse"/>
<wsdl:fault message="impl:AdminServiceException" name="AdminServiceException"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="AdaptiveAuthenticationAdminSoapBinding" type="impl:UserAdminService">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getUserStatus">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getUserStatusRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getUserStatusResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="AdminServiceException">
<wsdlsoap:fault name="AdminServiceException" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="UserAdminServiceService">
<wsdl:port binding="impl:AdaptiveAuthenticationAdminSoapBinding" name="AdaptiveAuthenticationAdmin">
<wsdlsoap:address location="http://server:83/AdaptiveAuthenticationAdmin/services/AdaptiveAuthenticationAdmin"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I created the code using wsdl2java as follows:
/opt/eco/ecoprd/axis2-1.6.1/bin >> ./wsdl2java.sh -u -uri test2.wsdl -or
Using AXIS2_HOME: /opt/eco/ecoprd/axis2-1.6.1
Using JAVA_HOME: /usr/local/jdk1.6.0_16
Retrieving document at 'test2.wsdl'.
But when I try to compile the code:
/opt/eco/ecoprd/axis2-1.6.1/bin >> javac -cp $CLASSPATH src/com/rsa/csd/ws/admin/*.java
src/com/rsa/csd/ws/admin/Fault.java:95: cannot find symbol
symbol : method serialize(javax.xml.namespace.QName,javax.xml.stream.XMLStreamWriter)
location: class com.rsa.csd.ws.admin.AdminServiceException
localFault.serialize(MY_QNAME,xmlWriter);
^
src/com/rsa/csd/ws/admin/Fault.java:278: cannot find symbol
symbol : method getPullParser(javax.xml.namespace.QName)
location: class com.rsa.csd.ws.admin.AdminServiceException
return localFault.getPullParser(MY_QNAME);
^
src/com/rsa/csd/ws/admin/Fault.java:326: cannot find symbol
symbol : variable Factory
location: class com.rsa.csd.ws.admin.AdminServiceException
object.setFault(com.rsa.csd.ws.admin.AdminServiceException.Factory.parse(reader));
^
src/com/rsa/csd/ws/admin/ExtensionMapper.java:28: cannot find symbol
symbol : variable Factory
location: class com.rsa.csd.ws.admin.AdminServiceException
return com.rsa.csd.ws.admin.AdminServiceException.Factory.parse(reader);
^
Note: src/com/rsa/csd/ws/admin/UserAdminServiceServiceStub.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
4 errors
I tried generating client with your 2nd wsdl using Eclipse IDE. It generated and compiled all well. That means wsdl is good to go.
Generated AdminServiceException.java
public class AdminServiceException extends java.lang.Exception{
private static final long serialVersionUID = 1333311238212L;
private com.rsa.csd.ws.admin.UserAdminServiceServiceStub.Fault faultMessage;
public AdminServiceException() {
super("AdminServiceException");
}
public AdminServiceException(java.lang.String s) {
super(s);
}
public AdminServiceException(java.lang.String s, java.lang.Throwable ex) {
super(s, ex);
}
public AdminServiceException(java.lang.Throwable cause) {
super(cause);
}
public void setFaultMessage(com.rsa.csd.ws.admin.UserAdminServiceServiceStub.Fault msg){
faultMessage = msg;
}
public com.rsa.csd.ws.admin.UserAdminServiceServiceStub.Fault getFaultMessage(){
return faultMessage;
}
}
For command line use : ./wsdl2java.sh -g -ssi -uri test2.wsdl
You don't have to mention -u, it will generate seperate classes for databinders implementing binding you have used.
wsdl2java should have generated a skeleton class and/or interface for the service class. Check the skeleton to see how the relevant service functions are declared. You'll probably find that they are declared to throw something like AdminServiceExceptionException. For some reason, Axis2 creates one class based on the definition of the fault in the WSDL, then another class extending Exception which acts as a container for the first class.
Just in case you are using JAXB data binding (JAXBRI), you have to make sure that your wsdl:message name (AdminServiceException) in the following element:
<wsdl:message name="AdminServiceException">
<wsdl:part element="impl:fault" name="fault"/>
</wsdl:message>
is different from element name (impl:fault). In your case they actually are different.
Otherwise you will get your "AdminServiceException does not extend java.lang.Exception" error.