All,
I am attempting to proxy some of our webservices, but have run into a small
problem.
1. Our codebase has a set of generated stubs, created by wsimport with our
webservice wsdl files
2. We need to be able to reuse these same stubs to point to both our
original webservice, as well as our synapse webservice proxy
3. However, when we try to use Synapse as a proxy, we get this error from
the stubs classes:
Port {http://ican.web.services}TelewestBindingPort is not found in service
...
{http://ican.web.services}ValidateCLI_Service in the wsdl
http://localhost:8280/services/ValidateCLI?wsdl
where *TelewestBindingPort* is the name of the binding name in our
original wsdl:
<...snip>
<binding name="TelewestBinding" type="jcapsws:TelewestPortType">
<soap:binding style="document" transport="
http://schemas.xmlsoap.org/soap/http"/>
<operation name="ValidateCLI">
</snip...>
4. Looking at the proxied wsdl returned by Synapse, we see that the original
binding name *TelewestBindingPort* is gone:
<...snip>
<wsdl:binding name="ValidateCLIHttpBinding"
type="jcapsws:ValidateCLIPortType">
<http:binding verb="POST"/>
</snip...>
Looking around, it seemed like using the service parameter 'useOriginalWsdl'
and 'modifyUserWSDLPortAddress' would be the way forward. However, I believe
I have been unable to get this feature to work, as the wsdl served up by
Synapse is completely identical no matter what value (true/false) these
parameters are set to. Perhaps I am misunderstanding how this feature works,
or perhaps I am going wrong in my synapse.xml. Not sure.
Here is my current setup:
-- Microsoft Windows XP Pro SP3
-- Java 1.6
-- A development snapshot of Synapse from 1-2 days ago
I realise that a development snapshot is in no way stable, but there have
been some crucial bugfixes to your codebase since the 1.2 release.
A complete, standalone test case can be downloaded from here:
http://sparklingideas.co.uk/synapse.test.case.henrik.zip* [28 MB]*
For convenience, I have also attached to this email:
1. *validateCli.wsdl* [Original WSDL file]
2. *proxied_validateCli.wsdl *[Proxied WSDL file, served up by Synapse]
3. *synapse.xml*
4. *stack.trace* [stacktrace from the wsimport stubs, when
"TelewestBindingPort" can not be found]
5. *generated.java.source.sample.java* [File generated by wsimport. Note
the hardcoded binding name "TelewestBindingPort"]
which can also be found in the zip file. Here is my proxy config:
<proxy name="ValidateCLI" transports="http" trace="enable">
<publishWSDL key="validateCli.wsdl" trace="enable">
<parameter name="useOriginalwsdl">true</parameter>
<parameter name="modifyUserWSDLPortAddress">true</parameter>
<resource location="ValidateCLIRequest_V1.0.xsd"
key="ValidateCLIRequest"/>
<resource location="ValidateCLIResponse_V1.0.xsd"
key="ValidateCLIResponse"/>
<resource location="commontypes.xsd"
key="CommonTypes"/>
</publishWSDL>
<target>
<inSequence></inSequence>
<outSequence></outSequence>
</target>
</proxy>
Unfortunately, I am unable to change our original wsdl file, nor can I
re-run the wsimport routine against the proxied webservice wsdl, to fix the
binding name problem. Pity.
If anyone has had any experience with these sort of issues around binding
names, I would be very grateful if you could share some of your experiences.
Perhaps I am doing something wrong in my configuration, or perhaps what I am
attempting to do is simply not possible (!)
Any help would be greatly appreciated.
Many thanks!
Sincerely,
Henrik Pettersen
Sparkling Ideas, ltd.
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:jcapsws="http://ican.web.services"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
targetNamespace="http://ican.web.services"
>
<types>
<xs:schema xmlns:req="urn:telewest.types.message.request"
xmlns:rsp="urn:telewest.types.message.response"
id="UID-xxxxxxx-xxxxxxxxxxxx-xxxxxx-xx"
targetNamespace="http://ican.web.services"
>
<xs:import namespace="urn:telewest.types.message.response" schemaLocation="ValidateCLIResponse_V1.0.xsd"/>
<xs:import namespace="urn:telewest.types.message.request" schemaLocation="ValidateCLIRequest_V1.0.xsd"/>
<xs:element name="InputMsg" type="req:ValidateCLIRequestCplxType"/>
<xs:element name="OutputMsg" type="rsp:ValidateCLIResponseCplxType"/>
<xs:element name="FaultMsg" type="xs:string"/>
</xs:schema>
</types>
<message name="ValidateCLIFault">
<part name="bodyUPF" element="jcapsws:FaultMsg"/>
</message>
<message name="ValidateCLIOutput">
<part name="bodyUPO" element="jcapsws:OutputMsg"/>
</message>
<message name="ValidateCLIInput">
<part name="bodyUPI" element="jcapsws:InputMsg"/>
</message>
<portType name="TelewestPortType">
<operation name="ValidateCLI">
<input name="inputMsgUP" message="jcapsws:ValidateCLIInput"/>
<output name="outputMsgUP" message="jcapsws:ValidateCLIOutput"/>
<fault name="errorMsgUP" message="jcapsws:ValidateCLIFault"/>
</operation>
</portType>
<binding name="TelewestBinding" type="jcapsws:TelewestPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="ValidateCLI">
<soap:operation soapAction="urn:ValidateCLI"/>
<input>
<soap:body parts="bodyUPI" use="literal"/>
</input>
<output>
<soap:body parts="bodyUPO" use="literal"/>
</output>
<fault name="errorMsgUP">
<soap:fault name="errorMsgUP" use="literal"/>
</fault>
</operation>
</binding>
<service name="ValidateCLI_Service">
<port name="TelewestBindingPort" binding="jcapsws:TelewestBinding">
<soap:address location="http://SERVER_NAME_AND_PORT_HIDDEN/ValidateCLI/TelewestBindingPort" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/>
</port>
</service>
</definitions><?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:jcapsws="http://ican.web.services" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://ican.web.services">
<wsdl:types>
<xs:schema xmlns:rsp="urn:telewest.types.message.response" xmlns:req="urn:telewest.types.message.request" attributeFormDefault="unqualified" elementFormDefault="unqualified" id="UID-xxxxxxx-xxxxxxxxxxxx-xxxxxx-xx" targetNamespace="http://ican.web.services">
<xs:import namespace="urn:telewest.types.message.response" schemaLocation="ValidateCLI?xsd=xsd0.xsd"/>
<xs:import namespace="urn:telewest.types.message.request" schemaLocation="ValidateCLI?xsd=xsd2.xsd"/>
<xs:element name="InputMsg" type="req:ValidateCLIRequestCplxType"/>
<xs:element name="OutputMsg" type="rsp:ValidateCLIResponseCplxType"/>
<xs:element name="FaultMsg" type="xs:string"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="ValidateCLIInput">
<wsdl:part name="bodyUPI" element="jcapsws:InputMsg"/>
</wsdl:message>
<wsdl:message name="ValidateCLIOutput">
<wsdl:part name="bodyUPO" element="jcapsws:OutputMsg"/>
</wsdl:message>
<wsdl:message name="ValidateCLIFault">
<wsdl:part name="bodyUPF" element="jcapsws:FaultMsg"/>
</wsdl:message>
<wsdl:portType name="ValidateCLIPortType">
<wsdl:operation name="ValidateCLI">
<wsdl:input message="jcapsws:ValidateCLIInput" wsaw:Action="urn:ValidateCLI"/>
<wsdl:output message="jcapsws:ValidateCLIOutput" wsaw:Action="http://ican.web.services/TelewestPortType/outputMsgUP"/>
<wsdl:fault message="jcapsws:ValidateCLIFault" name="ValidateCLIFault" wsaw:Action="urn:ValidateCLIValidateCLIFault"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ValidateCLISoap11Binding" type="jcapsws:ValidateCLIPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="ValidateCLI">
<soap:operation soapAction="urn:ValidateCLI" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="ValidateCLIFault">
<soap:fault use="literal" name="ValidateCLIFault"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="ValidateCLISoap12Binding" type="jcapsws:ValidateCLIPortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="ValidateCLI">
<soap12:operation soapAction="urn:ValidateCLI" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
<wsdl:fault name="ValidateCLIFault">
<soap12:fault use="literal" name="ValidateCLIFault"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="ValidateCLIHttpBinding" type="jcapsws:ValidateCLIPortType">
<http:binding verb="POST"/>
<wsdl:operation name="ValidateCLI">
<http:operation location="ValidateCLI/ValidateCLI"/>
<wsdl:input>
<mime:content type="text/xml" part="ValidateCLI"/>
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="ValidateCLI"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ValidateCLI">
<wsdl:port name="ValidateCLIHttpSoap11Endpoint" binding="jcapsws:ValidateCLISoap11Binding">
<soap:address location="http://Babylon.config:8280/services/ValidateCLI.ValidateCLIHttpSoap11Endpoint"/>
</wsdl:port>
<wsdl:port name="ValidateCLIHttpSoap12Endpoint" binding="jcapsws:ValidateCLISoap12Binding">
<soap12:address location="http://Babylon.config:8280/services/ValidateCLI.ValidateCLIHttpSoap12Endpoint"/>
</wsdl:port>
<wsdl:port name="ValidateCLIHttpEndpoint" binding="jcapsws:ValidateCLIHttpBinding">
<http:address location="http://Babylon.config:8280/services/ValidateCLI.ValidateCLIHttpEndpoint"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
package some.package.account.currentservicelist;
/**************************/
/* import statements here */
/**************************/
/**
* This class was generated by the JAXWS SI.
* JAX-WS RI 2.0_02-b08-fcs
* Generated source version: 2.0
*/
@WebServiceClient(name = "GetCurrentServicesList_Service", targetNamespace =
"http://ican.web.services", wsdlLocation =
"http://jcaps-wn-t1-1.telewest.co.uk:18001/GetCurrentServicesList/TelewestBindingPort?WSDL")
public class GetCurrentServicesListService extends Service {
private final static URL GETCURRENTSERVICESLISTSERVICE_WSDL_LOCATION;
private static Logger logger =
CustomLogger.getLogger(GetCurrentServicesListService.class);
static {
URL url = null;
try {
url = new
URL("HIDDEN_SERVER_NAME_AND_PORT/TelewestBindingPort?WSDL");
} catch (MalformedURLException e) {
logger.error("Malformed wdsl endpoint URL", e);
}
GETCURRENTSERVICESLISTSERVICE_WSDL_LOCATION = url;
}
public GetCurrentServicesListService(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}
public GetCurrentServicesListService() {
super(GETCURRENTSERVICESLISTSERVICE_WSDL_LOCATION, new
QName("http://ican.web.services", "GET_CURRENT_SERVICES_NAME"));
}
/**
* @return returns TelewestPortType
*/
@WebEndpoint(name = "TelewestBindingPort")
public CurrentServiceListPort getTelewestBindingPort() {
return (CurrentServiceListPort) super.getPort(new
QName("http://ican.web.services", "TelewestBindingPort"),
CurrentServiceListPort.class);
}
}<definitions xmlns="http://ws.apache.org/ns/synapse">
<localEntry key="validateCli.wsdl" src="file:/Users/henrik/dev/synapse-1.2/harness/validateCli.wsdl"/>
<localEntry key="ValidateCLIRequest" src="file:/Users/henrik/dev/synapse-1.2/harness/ValidateCLIRequest_V1.0.xsd"/>
<localEntry key="ValidateCLIResponse" src="file:/Users/henrik/dev/synapse-1.2/harness/ValidateCLIResponse_V1.0.xsd"/>
<localEntry key="CommonTypes" src="file:/Users/henrik/dev/synapse-1.2/harness/commontypes.xsd"/>
<proxy name="ValidateCLI" transports="http" trace="enable">
<publishWSDL key="validateCli.wsdl" trace="enable">
<parameter name="useOriginalwsdl">true</parameter>
<parameter name="modifyUserWSDLPortAddress">true</parameter>
<resource location="ValidateCLIRequest_V1.0.xsd" key="ValidateCLIRequest"/>
<resource location="ValidateCLIResponse_V1.0.xsd" key="ValidateCLIResponse"/>
<resource location="commontypes.xsd" key="CommonTypes"/>
</publishWSDL>
<target>
<inSequence></inSequence>
<outSequence></outSequence>
</target>
</proxy>
</definitions>