Abdul
Abdul

Reputation: 694

Creating wso2 esb proxy service on an endpoint which has references to XSD

I've created a pass through proxy service on top on a endpoint and selected Specify Source URL in publish wsdl options. The endpoint references to xsd's in the wsdl definition. The proxy web service generated fines, but when trying to load this web service from a client (SOAP UI), it throws an error because of the way the xsd is referenced in the proxy service wsdl URL.

Sample of Actual web service with an xsd definition

<types>
    <xsd:schema>
        <xsd:import namespace="http://service.example.com/" schemaLocation="http://172.16.91.82:7001/DemoService/DemoService?xsd=1"/>
    </xsd:schema>
</types>

Sample of the proxy service with a reference to schema.

<wsdl:types>
    <xsd:schema attributeFormDefault="unqualified" elementFormDefault="unqualified">
        <xsd:import namespace="http://service.example.com/" schemaLocation="SecuredServiceProxy?xsd=http://172.16.91.82:7001/DemoService/DemoService?xsd=1"/>
    </xsd:schema>
</wsdl:types>

The client has a problem loading the schema location (which of course looks invalid)

1) I'm looking at a way to get rid of this.

2) This proxy service is intended to hide the actual service from the end user. The way the xsd schema is listed in proxy service wsdl definition, is leaking the actual endpoint information to the end user. Is there a way to avoid the xsd url displayed in the generated wsdl definition of proxy service ?

Thanks.

Upvotes: 0

Views: 1294

Answers (2)

Roy
Roy

Reputation: 1225

So you mean to say that your endpoint is the URL and your publish wsdl is also url? you can try specifying your publish wsdl as inline and you can create a .xsd file in ESB_Home which should contain the contents of your xsd URL. And then you can refrence your .xsd file by changing the location from url to simply the name of the xsd file present in your ESB_Home directory in your inline wsdl as :

<wsdl:types>
    <xsd:schema attributeFormDefault="unqualified" elementFormDefault="unqualified">
        <xsd:import namespace="http://service.example.com/" schemaLocation="DemoService.xsd"/>
    </xsd:schema>
</wsdl:types>

Hope this works for you

Upvotes: 2

Isuru Perera
Isuru Perera

Reputation: 1905

If you need to hide to the actual service details from the end user, you can avoid publishing the WSDL in WSO2 ESB.

Then you will be invoke the Proxy Service defined in the ESB.

I hope this helps.

Thanks!

Upvotes: 0

Related Questions