简体   繁体   中英

Cannot import localhost urls from wsdl

I am trying to consume a WCF web service (which I did not write myself) using soap on an iPhone. I can test the service using SoapUI and .Net WebService Studio just fine when running the tools on the same web server. But when I try it from an other machine, both tools fail when attempting to import from localhost:

<wsdl:import namespace="http://MyDomain.IGeneralInterface" location="http://localhost:8000/?wsdl=wsdl0"/>

wsdl0:

<xsd:schema targetNamespace="http://MyDomain.IGeneralInterface/Imports">
<xsd:import schemaLocation="http://localhost:8000/?xsd=xsd0" namespace="http://MyDomain.IGeneralInterface"/>
<xsd:import schemaLocation="http://localhost:8000/?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/MyDomain.IGeneralInterface"/>
<xsd:import schemaLocation="http://localhost:8000/?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
<xsd:import schemaLocation="http://localhost:8000/?xsd=xsd3" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
<xsd:import schemaLocation="http://localhost:8000/?xsd=xsd4" namespace="http://schemas.microsoft.com/Message"/>
</xsd:schema>

I was hoping to be able to use wsdl2objc, but it cannot recognise the import either.

Can anyone please tell me why this is a problem and how to handle it???

The reason on why they fail is that your wsdl is not flat. For your WCF service to be interoperable you might consider flattening your wsdl. Please follow the link below:

How to flatten your wsdl .

NOTE : if you are .NET 4.5 then you would have this as an inbuilt feature. ie when you develop your service you would see an url that generates flat wsdl.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM