3

Why we use the targetNamespace in a wsdl file in web service, what is the actual purpose of targetNamespace ? I have a web service on http://example.com/webservice/catalog.php, I want to access the web service through a wordpress plugin. My plugins wsdl file is like below

<definitions name='shop'
  targetNamespace='http://example.com/soap/'
  xmlns:tns='http://example.com/soap/'
.
.
.
.
<service name='CatalogService'>
    <port name='CatalogPort' binding='CatalogBinding'>
      <soap:address location='http://example.com/webservice/soap-server.php'/>
    </port>
  </service>

I wrote to see some example below two lines, is it ok?

targetNamespace='http://example.com/soap/'
xmlns:tns='http://example.com/soap/'

I can not understand what is the actual purpose of targetNamespace in wsdl file.

4

1 回答 1

1

众所周知,WSDL 文件可以导入其他 WSDL 文件,总是存在名称冲突的可能性。在 targetnamespace 的帮助下,我们可以确保 taget 标记不会与您的 wsdl 中的任何其他内容发生冲突。您可以阅读更多内容... IBM - Web Service (r)evolution Part-4

于 2012-09-07T07:09:04.047 回答