I've a problem during deploying application on jboss. I found some information that changing version of woodstox might help, but it wasn't...
Log:
16:58:09,079 INFO [stdout] (MSC service thread 1-2) [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] Failed to parse WSDL
16:58:09,080 INFO [stdout] (MSC service thread 1-2) javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: java.lang.RuntimeException: Cannot create a secure XMLInputFactory
16:58:09,080 INFO [stdout] (MSC service thread 1-2) at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:257)
16:58:09,104 INFO [stdout] (MSC service thread 1-2) Caused by: java.lang.RuntimeException: Cannot create a secure XMLInputFactory
16:58:09,104 INFO [stdout] (MSC service thread 1-2) at org.apache.cxf.staxutils.StaxUtils.createXMLInputFactory(StaxUtils.java:312)
16:58:09,514 ERROR [org.springframework.web.context.ContextLoader] (MSC service thread 1-2) Context initialization failed: org.apache.camel.FailedToCreateProducerException: Failed to create Producer for endpoint: Endpoint[cxf://bean:adapter.NotificationService?dataFormat=PAYLOAD]. Reason: org.apache.cxf.service.factory.ServiceConstructionException: No valid WSDL classpath:/interface/adapter/notification-service/v10/NotificationService.wsdl nor service class is specified.
at org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:409) [camel-core-2.12.3.jar:2.12.3]
at org.apache.camel.impl.ProducerCache.acquireProducer(ProducerCache.java:123) [camel-core-2.12.3.jar:2.12.3]
I've absolutely no idea what else can i check... My environment:
svn 1.7.9 (r1462340) Apache Maven 3.1.1
(0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 Maven home:
Java version: 1.7.0_45, vendor: Oracle Corporation OS name: "linux",
version: "3.11.0-12-generic", arch: "amd64", family: "unix" javac
1.7.0_45 java version "1.7.0_45" Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Woodstox inside jboss: 4.1.1 (I was changing it to 4.2.1 and 4.2.0)
My wsdl definition:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions name="NotificationService"
targetNamespace="http://service/NotificationService/v10"
xmlns:tns="http://service/NotificationService/v10"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<wsdl:types>
<xs:schema
targetNamespace="http://service/NotificationService/v10">
<xs:include schemaLocation="NotificationService.xsd" />
</xs:schema>
</wsdl:types>
<!-- notifyPaymentStatus message-->
<wsdl:message name="notifyPaymentStatusParameters">
<wsdl:part name="notifyPaymentStatusPart" element="tns:notifyPaymentStatusRQ">
</wsdl:part>
</wsdl:message>
<wsdl:message name="notifyPaymentStatusResult">
<wsdl:part name="notifyPaymentStatusPart" element="tns:notifyPaymentStatusRS">
</wsdl:part>
</wsdl:message>
<!-- notifyError message-->
<wsdl:message name="notifyErrorParameters">
<wsdl:part name="notifyErrorPart" element="tns:notifyErrorRQ">
</wsdl:part>
</wsdl:message>
<wsdl:message name="notifyErrorResult">
<wsdl:part name="notifyErrorPart" element="tns:notifyErrorRS">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="NotificationService">
<wsdl:operation name="notifyPaymentStatus">
<wsdl:input name="notifyPaymentStatusParameters" message="tns:notifyPaymentStatusParameters" />
<wsdl:output name="notifyPaymentStatusResult" message="tns:notifyPaymentStatusResult" />
</wsdl:operation>
<wsdl:operation name="notifyError">
<wsdl:input name="notifyErrorParameters" message="tns:notifyErrorParameters" />
<wsdl:output name="notifyErrorResult" message="tns:notifyErrorResult" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="NotificationServiceBinding" type="tns:NotificationService">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="notifyPaymentStatus">
<soap:operation soapAction="" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="notifyError">
<soap:operation soapAction="" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="NotificationService">
<wsdl:port name="NotificationServicePort" binding="tns:NotificationServiceBinding">
<soap:address location="http://www.example.org/" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
and endpoint:
<cxf:cxfEndpoint id="adapter.NotificationService"
endpointName="s:NotificationServicePort" serviceName="s:NotificationService"
wsdlURL="classpath:/interface/adapter/notification-service/v10/NotificationService.wsdl"
xmlns:s="http://service/NotificationService/v10">
<cxf:properties>
<entry key="schema-validation-enabled"
value="true" />
</cxf:properties>
<cxf:inInterceptors>
<ref bean="logInInterceptor" />
</cxf:inInterceptors>
<cxf:inFaultInterceptors>
<ref bean="logInInterceptor" />
</cxf:inFaultInterceptors>
<cxf:outInterceptors>
<ref bean="logOutInterceptor" />
</cxf:outInterceptors>
<cxf:outFaultInterceptors>
<ref bean="logOutInterceptor" />
</cxf:outFaultInterceptors>
</cxf:cxfEndpoint>
When i was debugging i found some property, which is called:
org.apache.cxf.stax.allowInsecureParser. How can I set it on true? In these case probably I won't have any problems with parsing wsdl.
this one workaround works fine for me:
<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject">
<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetClass" value="java.lang.System" />
<property name="targetMethod" value="getProperties" />
</bean>
</property>
<property name="targetMethod" value="putAll" />
<property name="arguments">
<util:properties>
<prop key="org.apache.cxf.stax.allowInsecureParser">true</prop>
</util:properties>
</property>
</bean>
from :
CXF 2.7.x Woodstox Compatibility via Maven
I found that in my dependencies I've correct lib: 4-2-0, but I don't know why jboss is using another lib from somewhere... In my opinion better sollution would be to set on jboss to not overwrite libraries. In another case I'm still getting warning like this:
2014-06-27 12:59:58,932 WARN (MSC service thread 1-16) [org.apache.cxf.staxutils.StaxUtils] Could not create a secure Stax XMLInputFactory. Found class com.ctc.wstx.stax.WstxInputFactory. Suggest Woodstox 4.2.0 or newer.
Related
I am new to soap web services,wanted to know can we change the location of soap:address according to the environment it is deployed. I am using jaxws-spring
<binding name="HelloWorldWSPortBinding" type="tns:HelloWorldWS">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<operation name="getHelloWorld"></binding>
<service name="HelloWorldWSService">
<port name="HelloWorldWSPort" binding="tns:HelloWorldWSPortBinding">
<soap:address location="http://localhost:8095/WebServicesExample/hello" />
</port>
</service>
</definitions>
I have already tried some hints but I get this problem not solved. I validated the wsdl with xmlspy-client and it says it and the xsd are valid.
When I send a Request like this with SOAPUI I get the Exception mentioned (cvc-elt.1.a: Cannot find the declaration of element 'soapenv:Body').
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://schemas.domain.com/wsdl/fuelprice/v1" xmlns:mod="http://schemas.domain.com/wsdl/fuelprice/v1/model">
<soapenv:Header/>
<soapenv:Body>
<v1:AuthenticationHeader client="client">
<v1:token>token</v1:token>
</v1:AuthenticationHeader>
<v1:GetAreaFuelStationsRequest provider="p1" prices="true">
<v1:area>
<mod:center ellipsoid="false">
<mod:latitude>22.519172</mod:latitude>
<mod:longitude>13.406093</mod:longitude>
</mod:center>
<mod:radius>10</mod:radius>
</v1:area>
</v1:GetAreaFuelStationsRequest>
</soapenv:Body>
</soapenv:Envelope>
I have tried importing the soap schema in the wsdl. After it I got an error message:
"cvc-complex-type.2.4.a: Invalid content was found starting with element 'v1:latitude'. One of '{"http://schemas.domain.com/wsdl/fuelprice/v1/model":latitude}' is expected.".
I honestly work with rest and json and have some difficulties with this schema-configuration.
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="wsdl-viewer.xsl"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://schemas.domain.com/wsdl/fuelprice/v1" xmlns:model="http://schemas.domain.com/wsdl/fuelprice/v1/model" xmlns:exception="http://schemas.domain.com/wsdl/fuelprice/v1/exception" targetNamespace="http://schemas.domain.com/wsdl/fuelprice/v1">
<wsdl:types>
<xsi:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schemas.domain.com/wsdl/fuelprice/v1" elementFormDefault="qualified">
<xsi:import namespace="http://schemas.domain.com/wsdl/fuelprice/v1/model" schemaLocation="common.xsd"/>
<xsi:import namespace="http://schemas.domain.com/wsdl/fuelprice/v1/exception" schemaLocation="exception.xsd"/>
<xsi:element name="GetAreaFuelStationsRequest">
<xsi:complexType>
<xsi:sequence>
<xsi:element name="area" type="model:Area"/>
</xsi:sequence>
<xsi:attribute name="provider" type="xsi:string" use="optional"/>
<xsi:attribute name="prices" type="xsi:boolean" use="required"/>
</xsi:complexType>
</xsi:element>
<xsi:element name="GetAreaFuelStationsResponse">
<xsi:complexType>
<xsi:sequence>
<xsi:element name="entry" type="model:SearchResult" minOccurs="0" maxOccurs="unbounded"/>
</xsi:sequence>
<xsi:attribute name="countTotal" type="xsi:int" use="optional"/>
</xsi:complexType>
</xsi:element>
</xsi:schema>
</wsdl:types>
<wsdl:message name="SearchAreaFuelStationsRequest">
<wsdl:part name="auth" element="tns:AuthenticationHeader"/>
<wsdl:part name="body" element="tns:GetAreaFuelStationsRequest"/>
</wsdl:message>
<wsdl:message name="SearchAreaFuelStationsResponse">
<wsdl:part name="body" element="tns:GetAreaFuelStationsResponse"/>
</wsdl:message>
<wsdl:portType name="FuelDataService">
<wsdl:operation name="GetAreaFuelStations">
<wsdl:input message="tns:GetAreaFuelStationsRequest"/>
<wsdl:output message="tns:GetAreaFuelStationsResponse"/>
<wsdl:fault name="ServiceError" message="tns:ServiceErrorFault"/>
<wsdl:fault name="AuthenticationError" message="tns:AuthenticationErrorFault"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="FuelDataService" type="tns:FuelDataService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetAreaFuelStations">
<soap:operation soapAction="urn:GetAreaFuelStations"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="ServiceError"/>
<wsdl:fault name="AuthenticationError"/>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="FuelDataService">
<wsdl:port name="FuelDataService" binding="tns:FuelDataService">
<soap:address location="No target address"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
The XSD:
<?xml version="1.0" encoding="UTF-8"?>
<xsi:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema" xmlns:model="http://schemas.domain.com/wsdl/fuelprice/v1/model" targetNamespace="http://schemas.domain.com/wsdl/fuelprice/v1/model" elementFormDefault="qualified">
<xsi:complexType name="FuelStation">
<xsi:sequence>
<xsi:element name="location" type="model:GeoLocation"/>
<xsi:element name="name" type="xsi:string"/>
</xsi:sequence>
<xsi:attribute name="id" type="xsi:long" use="optional"/>
</xsi:complexType>
<xsi:complexType name="GeoLocation">
<xsi:sequence>
<xsi:element name="latitude" type="xsi:double"/>
<xsi:element name="longitude" type="xsi:double"/>
</xsi:sequence>
<xsi:attribute name="ellipsoid" type="xsi:string" use="required"/>
</xsi:complexType>
<xsi:complexType name="Area">
<xsi:sequence>
<xsi:element name="center" type="model:GeoLocation"/>
<xsi:element name="radius" type="xsi:float"/>
</xsi:sequence>
</xsi:complexType>
</xsi:schema>
For me is not obvious what I should change to get this working. Does anybody knows what is wrong with the namespace setting? I would appreciate any help.
This Question was solved with the Question validating SOAP-Request with a SOAPHandler
Extracting the body of message, adding the needed namespace in the schema and validating the body as a Document did the trick.
I have tried PassThroughu proxy tutorials and all works with build in example where Target Web Service is deployed on Axis (Apache CFX). Source and Proxy Web Service nicely gets tested using "TryIt" on WSO2 ESB.
Now different story - I try to achieve the same using very simple Weblogic Spring Web Service (i don't believe usage of Spring and bottom-up approach and annotations matter). It's deployed on the WebLogic server (running on the same host as WSO2 ESB). No any special WS-* extension included. It's almost hello world web service. I can easily test test it SoapUi, UniversalTestClient (WebLogic) and see WSDL in browser.
Regarding generated proxy PassThrough Web Service (followed same steps from tutorial) I can also see generated WSDL:
http://localhost:8280/services/WebServiceAServicePassThroughProxy?wsdl
However neither SoapUI nor TryIt work and both return FaultString:
The endpoint reference (EPR) for the Operation not found is /services/WebServiceAServicePassThroughProxy.WebServiceAServicePassThroughProxyHttpSoap11Endpoint and the WSA Action = . If this EPR was previously reachable, please contact the server administrator.
Here is function I used for testing "findContactById":
<body>
<p:findContactById xmlns:p="http://webservicea.testtoold.xx.yy.zz.eu/">
<!--Exactly 1 occurrence-->
<arg0>1</arg0>
</p:findContactById>
</body>
which operates on Proxy Web Service. I tried all endpoints that were generated in proxy web service, error is same as above unless if I try httpEndpoint from drop down:
http://localhost:8280/services/WebServiceAServicePassThroughProxy.WebServiceAServicePassThroughProxyHttpEndpoint
then I get Unsupported Media Type as TryItProxyError.
Anyone please help, I am getting nuts with this... should be simple, not the nightmare. Searched all web i saw few similar questions with no answers.
WebLogic Service WSDL:
<?xml version='1.0' encoding='UTF-8'?><!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.8-b13937 svn-revision#13942. --><!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.8-b13937 svn-revision#13942. --><definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://webservicea.testtoold.xx.yy.zz.eu/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://webservicea.testtoold.xx.yy.zz.eu/" name="WebServiceAService">
<types>
<xsd:schema>
<xsd:import namespace="http://webservicea.testtoold.xx.yy.zz.eu/" schemaLocation="http://localhost:7001/TestToolD/WebServiceAService?xsd=1"/>
</xsd:schema>
</types>
<message name="findContactById">
<part name="parameters" element="tns:findContactById"/>
</message>
<message name="findContactByIdResponse">
<part name="parameters" element="tns:findContactByIdResponse"/>
</message>
<message name="Exception">
<part name="fault" element="tns:Exception"/>
</message>
<message name="findAllContacts">
<part name="parameters" element="tns:findAllContacts"/>
</message>
<message name="findAllContactsResponse">
<part name="parameters" element="tns:findAllContactsResponse"/>
</message>
<portType name="WebServiceA">
<operation name="findContactById">
<input wsam:Action="http://webservicea.testtoold.xx.yy.zz.eu/WebServiceA/findContactByIdRequest" message="tns:findContactById"/>
<output wsam:Action="http://webservicea.testtoold.xx.yy.zz.eu/WebServiceA/findContactByIdResponse" message="tns:findContactByIdResponse"/>
<fault message="tns:Exception" name="Exception" wsam:Action="http://webservicea.testtoold.xx.yy.zz.eu/WebServiceA/findContactById/Fault/Exception"/>
</operation>
<operation name="findAllContacts">
<input wsam:Action="http://webservicea.testtoold.xx.yy.zz.eu/WebServiceA/findAllContactsRequest" message="tns:findAllContacts"/>
<output wsam:Action="http://webservicea.testtoold.xx.yy.zz.eu/WebServiceA/findAllContactsResponse" message="tns:findAllContactsResponse"/>
<fault message="tns:Exception" name="Exception" wsam:Action="http://webservicea.testtoold.xx.yy.zz.eu/WebServiceA/findAllContacts/Fault/Exception"/>
</operation>
</portType>
<binding name="WebServiceAPortBinding" type="tns:WebServiceA">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="findContactById">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
<fault name="Exception">
<soap:fault name="Exception" use="literal"/>
</fault>
</operation>
<operation name="findAllContacts">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
<fault name="Exception">
<soap:fault name="Exception" use="literal"/>
</fault>
</operation>
</binding>
<service name="WebServiceAService">
<port name="WebServiceAPort" binding="tns:WebServiceAPortBinding">
<soap:address location="http://localhost:7001/TestToolD/WebServiceAService"/>
</port>
</service>
</definitions>
WSO ESB Generated PassThroughProxy.wsdl
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:tns="http://webservicea.testtoold.xx.yy.zz.eu/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://webservicea.testtoold.xx.yy.zz.eu/">
<wsdl:types>
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="unqualified">
<xsd:import namespace="http://webservicea.testtoold.xx.yy.zz.eu/" schemaLocation="WebServiceAServicePassThroughProxy?xsd=http://localhost:7001/TestToolD/WebServiceAService?xsd=1.xsd"></xsd:import>
</xsd:schema>
</wsdl:types>
<wsdl:message name="findContactById">
<wsdl:part name="parameters" element="tns:findContactById"></wsdl:part>
</wsdl:message>
<wsdl:message name="findContactByIdResponse">
<wsdl:part name="parameters" element="tns:findContactByIdResponse"></wsdl:part>
</wsdl:message>
<wsdl:message name="findAllContacts">
<wsdl:part name="parameters" element="tns:findAllContacts"></wsdl:part>
</wsdl:message>
<wsdl:message name="findAllContactsResponse">
<wsdl:part name="parameters" element="tns:findAllContactsResponse"></wsdl:part>
</wsdl:message>
<wsdl:portType name="WebServiceAServicePassThroughProxyPortType">
<wsdl:operation name="findContactById">
<wsdl:input message="tns:findContactById"></wsdl:input>
<wsdl:output message="tns:findContactByIdResponse" wsaw:Action="http://webservicea.testtoold.xx.yy.zz.eu/WebServiceA/findContactByIdResponse"></wsdl:output>
<wsdl:fault message="tns:Exception" name="Exception" wsaw:Action="http://webservicea.testtoold.xx.yy.zz.eu/WebServiceA/findContactById/Fault/Exception"></wsdl:fault>
</wsdl:operation>
<wsdl:operation name="findAllContacts">
<wsdl:input message="tns:findAllContacts"></wsdl:input>
<wsdl:output message="tns:findAllContactsResponse" wsaw:Action="http://webservicea.testtoold.xx.yy.zz.eu/WebServiceA/findAllContactsResponse"></wsdl:output>
<wsdl:fault message="tns:Exception" name="Exception" wsaw:Action="http://webservicea.testtoold.xx.yy.zz.eu/WebServiceA/findAllContacts/Fault/Exception"></wsdl:fault>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="WebServiceAServicePassThroughProxySoap11Binding" type="tns:WebServiceAServicePassThroughProxyPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"></soap:binding>
<wsdl:operation name="findContactById">
<soap:operation soapAction="" 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:fault name="Exception">
<soap:fault use="literal" name="Exception"></soap:fault>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="findAllContacts">
<soap:operation soapAction="" 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:fault name="Exception">
<soap:fault use="literal" name="Exception"></soap:fault>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="WebServiceAServicePassThroughProxySoap12Binding" type="tns:WebServiceAServicePassThroughProxyPortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"></soap12:binding>
<wsdl:operation name="findContactById">
<soap12:operation soapAction="" 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:fault name="Exception">
<soap12:fault use="literal" name="Exception"></soap12:fault>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="findAllContacts">
<soap12:operation soapAction="" 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:fault name="Exception">
<soap12:fault use="literal" name="Exception"></soap12:fault>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="WebServiceAServicePassThroughProxyHttpBinding" type="tns:WebServiceAServicePassThroughProxyPortType">
<http:binding verb="POST"></http:binding>
<wsdl:operation name="findContactById">
<http:operation location="findContactById"></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:operation name="findAllContacts">
<http:operation location="findAllContacts"></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="WebServiceAServicePassThroughProxy">
<wsdl:port name="WebServiceAServicePassThroughProxyHttpsSoap11Endpoint" binding="tns:WebServiceAServicePassThroughProxySoap11Binding">
<soap:address location="https://supercomputer:8243/services/WebServiceAServicePassThroughProxy.WebServiceAServicePassThroughProxyHttpsSoap11Endpoint"></soap:address>
</wsdl:port>
<wsdl:port name="WebServiceAServicePassThroughProxyHttpSoap11Endpoint" binding="tns:WebServiceAServicePassThroughProxySoap11Binding">
<soap:address location="http://supercomputer:8280/services/WebServiceAServicePassThroughProxy.WebServiceAServicePassThroughProxyHttpSoap11Endpoint"></soap:address>
</wsdl:port>
<wsdl:port name="WebServiceAServicePassThroughProxyHttpSoap12Endpoint" binding="tns:WebServiceAServicePassThroughProxySoap12Binding">
<soap12:address location="http://supercomputer:8280/services/WebServiceAServicePassThroughProxy.WebServiceAServicePassThroughProxyHttpSoap12Endpoint"></soap12:address>
</wsdl:port>
<wsdl:port name="WebServiceAServicePassThroughProxyHttpsSoap12Endpoint" binding="tns:WebServiceAServicePassThroughProxySoap12Binding">
<soap12:address location="https://supercomputer:8243/services/WebServiceAServicePassThroughProxy.WebServiceAServicePassThroughProxyHttpsSoap12Endpoint"></soap12:address>
</wsdl:port>
<wsdl:port name="WebServiceAServicePassThroughProxyHttpsEndpoint" binding="tns:WebServiceAServicePassThroughProxyHttpBinding">
<http:address location="https://supercomputer:8243/services/WebServiceAServicePassThroughProxy.WebServiceAServicePassThroughProxyHttpsEndpoint"></http:address>
</wsdl:port>
<wsdl:port name="WebServiceAServicePassThroughProxyHttpEndpoint" binding="tns:WebServiceAServicePassThroughProxyHttpBinding">
<http:address location="http://supercomputer:8280/services/WebServiceAServicePassThroughProxy.WebServiceAServicePassThroughProxyHttpEndpoint"></http:address>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Few minor remarks:
differences in localhost and supercomputer can't be the cause - tutorials work well with such diffs
i tried lots of things (creating endpoint in registry, or locally, providing WSDL or not when creating proxy, etc etc, but I always get the identical error).
i have cut out 30% lines of code to simplify WSDL (save and delete functions) to reach allowed size of post.
tried adding action names but no difference (kept example without them)
Since ESB 4.6, pass-through transport is enabled by default : The message body is not build so, SOAP Body based dispatching is not supported (can't use the first child node of SOAP body element to determine the operation).
The error in this case is The endpoint reference (EPR) for the Operation not found is...
In your case, you can't use SOAPAction (it's blank), but you can :
append the operation name to the endpoint URL
Or, since ESB 4.8 :
add this parameter in the proxy conf : <parameter name="disableOperationValidation" locked="false">true</parameter>
modify axis2.xml conf in repository/conf/axis2 replacing
<handler class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher" name="SOAPMessageBodyBasedDispatcher"/>
with
<handler class="org.apache.synapse.core.axis2.SynapseSOAPMessageBodyBasedDispatcher" name="SOAPMessageBodyBasedDispatcher"/>
We want to create a WSDL proxy on WSO2 ESB. The WSDL has 2 ports defined, each port defines its own
operations.
The problem is when I create the WSDL proxy and specify one of the port, the operation associated with that port is not exposed, rather the operation associated with port 2 is exposed... looks like no matter which port I point to, the operation exposed doesnt change..
My question is how can i make this work, or multiple ports in WSDL is not supported by WSO2 ESB ?
......
<wsdl:portType name="IxxxxService">
<wsdl:operation name="xxxRecordEntry">
<wsdl:input
wsaw:Action="http://tempuri.org/IxxxService/xxxRecordEntry"
message="tns:IxxxService_xxxRecordEntry_InputMessage" />
<wsdl:output
wsaw:Action="http://tempuri.org/IxxxService/xxxRecordEntryResponse"
message="tns:IxxxService_xxxRecordEntry_OutputMessage" />
</wsdl:operation>
<wsdl:operation name="xxxRecord">
<wsdl:input
wsaw:Action="http://tempuri.org/IxxxServiceMoniker/xxxRecord"
message="tns:IxxxServiceMoniker_xxxRecord_InputMessage" />
<wsdl:output
wsaw:Action="http://tempuri.org/IxxxServiceMoniker/xxxRecordResponse"
message="tns:IxxxServiceMoniker_xxxRecord_OutputMessage" />
</wsdl:operation>
</wsdl:portType>
<wsdl:portType name="IxxxServiceMoniker">
<wsdl:operation name="xxxRecord">
<wsdl:input
wsaw:Action="http://tempuri.org/IxxxMoniker/xxxRecord"
message="tns:IxxxServiceMoniker_xxxRecord_InputMessage" />
<wsdl:output
wsaw:Action="http://tempuri.org/IxxxServiceMoniker/xxxRecordResponse"
message="tns:IxxxServiceMoniker_xxxRecord_OutputMessage" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BasicHttpBinding_IxxxService"
type="tns:IxxxService">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="xxxRecordEntry">
<soap:operation
soapAction="http://tempuri.org/IxxxService/xxxRecordEntry"
style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="BasicHttpBinding_IxxxMoniker"
type="tns:IxxxMoniker">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="xxxRecord">
<soap:operation
soapAction="http://tempuri.org/IxxxMoniker/xxxRecord"
style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="xxxService">
<wsdl:port name="BasicHttpBinding_IxxxService" binding="tns:BasicHttpBinding_IxxxService">
<soap:address location="http://aaaaa:pppp/xxxService.xxxService.svc"/>
</wsdl:port>
<wsdl:port name="BasicHttpBinding_IxxxServiceMoniker" binding="tns:BasicHttpBinding_IxxxServiceMoniker">
<soap:address location="http://aaaaa:pppp/xxxService.xxxService.svc/mo"/>
</wsdl:port>
</wsdl:service>
Proxy Configuration
<proxy xmlns="http://ws.apache.org/ns/synapse" name="testing20" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<outSequence>
<send/>
</outSequence>
<endpoint>
<wsdl service="xxxService" port="BasicHttpBinding_IxxxService" uri="http://xxx:ppp/xxxLoggerService.xxxService.svc?wsdl"/>
</endpoint>
</target>
<publishWSDL uri="http://xxx:ppp/xxxLoggerService.xxxService.svc?wsdl"/>
<parameter name="useOriginalwsdl">true</parameter>
<parameter name="modifyUserWSDLPortAddress">true</parameter>
<description></description>
</proxy>
What is your proxy configuration? And which operations caused issue?
When you create proxy, you can disable unwanted bindings.That is, you can disable soap11 or soap12.
eg:<parameter name="disableSOAP12">true</parameter>
I'm learning about wso2 ESB 4.6.0. I'm studying right now about mediators. I implemented cache mediator as below.
<proxy xmlns="http://ws.apache.org/ns/synapse" name="cacheProxy" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence>
<cache id="myCache" scope="per-mediator" collector="false" hashGenerator="org.wso2.caching.digest.DOMHASHGenerator" timeout="3" maxMessageSize="1000">
<implementation type="memory" maxSize="1000"/>
</cache>
<send>
<endpoint>
<address uri="http://localhost:44444/ws/MediatorsWS"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<cache id="myCache" scope="per-mediator" collector="true"/>
<send/>
</outSequence>
<endpoint>
<address uri="http://localhost:44444/ws/MediatorsWS"/>
</endpoint>
</target>
<publishWSDL uri="http://localhost:44444/ws/MediatorsWS?wsdl"/>
<description></description>
</proxy>
It redirects to a webservice implemented with JAX-WS receiving SOAP 1.1. Here is the wsdl:
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:tns="http://clone.ws.wso2lessons/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://clone.ws.wso2lessons/">
<wsdl:types>
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="unqualified">
<xsd:import namespace="http://clone.ws.wso2lessons/" schemaLocation="cacheProxy?xsd=http://localhost:44444/ws/MediatorsWS?xsd=1.xsd"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="receiveMessage">
<wsdl:part name="parameters" element="tns:receiveMessage"/>
</wsdl:message>
<wsdl:message name="receiveMessageResponse">
<wsdl:part name="parameters" element="tns:receiveMessageResponse"/>
</wsdl:message>
<wsdl:message name="replyMessage">
<wsdl:part name="parameters" element="tns:replyMessage"/>
</wsdl:message>
<wsdl:message name="replyMessageResponse">
<wsdl:part name="parameters" element="tns:replyMessageResponse"/>
</wsdl:message>
<wsdl:portType name="cacheProxyPortType">
<wsdl:operation name="receiveMessage">
<wsdl:input message="tns:receiveMessage" wsaw:Action="http://clone.ws.wso2lessons/MediatorsWS/receiveMessageRequest"/>
<wsdl:output message="tns:receiveMessageResponse" wsaw:Action="http://clone.ws.wso2lessons/MediatorsWS/receiveMessageResponse"/>
</wsdl:operation>
<wsdl:operation name="replyMessage">
<wsdl:input message="tns:replyMessage" wsaw:Action="http://clone.ws.wso2lessons/MediatorsWS/replyMessageRequest"/>
<wsdl:output message="tns:replyMessageResponse" wsaw:Action="http://clone.ws.wso2lessons/MediatorsWS/replyMessageResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="cacheProxySoap11Binding" type="tns:cacheProxyPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="receiveMessage">
<soap:operation soapAction="" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="replyMessage">
<soap:operation soapAction="" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="cacheProxySoap12Binding" type="tns:cacheProxyPortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="receiveMessage">
<soap12:operation soapAction="" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="replyMessage">
<soap12:operation soapAction="" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="cacheProxyHttpBinding" type="tns:cacheProxyPortType">
<http:binding verb="POST"/>
<wsdl:operation name="receiveMessage">
<http:operation location="receiveMessage"/>
<wsdl:input>
<mime:content type="text/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="replyMessage">
<http:operation location="replyMessage"/>
<wsdl:input>
<mime:content type="text/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="cacheProxy">
<wsdl:port name="cacheProxyHttpSoap11Endpoint" binding="tns:cacheProxySoap11Binding">
<soap:address location="http://PCPPTCERTDEV01:8280/services/cacheProxy.cacheProxyHttpSoap11Endpoint"/>
</wsdl:port>
<wsdl:port name="cacheProxyHttpsSoap11Endpoint" binding="tns:cacheProxySoap11Binding">
<soap:address location="https://PCPPTCERTDEV01:8243/services/cacheProxy.cacheProxyHttpsSoap11Endpoint"/>
</wsdl:port>
<wsdl:port name="cacheProxyHttpsSoap12Endpoint" binding="tns:cacheProxySoap12Binding">
<soap12:address location="https://PCPPTCERTDEV01:8243/services/cacheProxy.cacheProxyHttpsSoap12Endpoint"/>
</wsdl:port>
<wsdl:port name="cacheProxyHttpSoap12Endpoint" binding="tns:cacheProxySoap12Binding">
<soap12:address location="http://PCPPTCERTDEV01:8280/services/cacheProxy.cacheProxyHttpSoap12Endpoint"/>
</wsdl:port>
<wsdl:port name="cacheProxyHttpsEndpoint" binding="tns:cacheProxyHttpBinding">
<http:address location="https://PCPPTCERTDEV01:8243/services/cacheProxy.cacheProxyHttpsEndpoint"/>
</wsdl:port>
<wsdl:port name="cacheProxyHttpEndpoint" binding="tns:cacheProxyHttpBinding">
<http:address location="http://PCPPTCERTDEV01:8280/services/cacheProxy.cacheProxyHttpEndpoint"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
When I send a message to operation replyMessage, the response message is cached succesfully (there is a System.out.println() on the java method, which is not called at the cache timeframe). However, the returned message I get is this:
<axis2ns27:binary xmlns:axis2ns27="http://ws.apache.org/commons/ns/payload">PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxTOkVudmVsb3BlIHhtbG5zOlM9Imh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3NvYXAvZW52ZWxvcGUvIj48UzpCb2R5PjxuczI6cmVwbHlNZXNzYWdlUmVzcG9uc2UgeG1sbnM6bnMyPSJodHRwOi8vY2xvbmUud3Mud3NvMmxlc3NvbnMvIj48cmV0dXJuPmhlbGxvIHRoZXJlIHJlc3BvbmRpZGEuPC9yZXR1cm4+PC9uczI6cmVwbHlNZXNzYWdlUmVzcG9uc2U+PC9TOkJvZHk+PC9TOkVudmVsb3BlPg==</axis2ns27:binary>
If I don't use this mediator, message is returned correctly. What am I missing here?
we use passthrough transport, it doesnt build the message..Can you switch back to NIO transport and check?