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

混江龙づ霸主 提交于 2019-12-11 19:24:14

问题


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.


回答1:


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




回答2:


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!



来源:https://stackoverflow.com/questions/17338785/creating-wso2-esb-proxy-service-on-an-endpoint-which-has-references-to-xsd

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!