首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >地址不匹配的WSDL2OBJC问题

地址不匹配的WSDL2OBJC问题
EN

Stack Overflow用户
提问于 2011-06-10 17:05:11
回答 1查看 1K关注 0票数 1

我已经创建了一个Windows服务,并为它生成了WSDL。我正在使用基本的http绑定。当我试图从IOS (使用生成的basicHttpBinding wsdl2objc类)调用它时,在调用WCF方法之一时会出现一个错误。错误(来自logXMLInOut)指出问题是由于地址错配造成的,但是我不知道如何调试它和\或者我做错了什么。

以下是完整的错误消息:

代码语言:javascript
复制
2011-06-10 11:54:05.534 IpadWebServiceTest[10149:207] OutputHeaders:
{
    "Content-Length" = 462;
    "Content-Type" = "application/soap+xml; charset=utf-8";
    Host = "192.168.1.69";
    Soapaction = "FredIannon.TestService/IHelloIndigoService/FredContractNoParm";
    "User-Agent" = wsdl2objc;
}
2011-06-10 11:54:05.536 IpadWebServiceTest[10149:207] OutputBody:
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:HelloIndigoService="FredIannon.TestService" xmlns:tns1="http://schemas.microsoft.com/2003/10/Serialization/" xsl:version="1.0">
  <soap:Body>
    <HelloIndigoService:FredContractNoParm/>
  </soap:Body>
</soap:Envelope>
2011-06-10 11:54:05.589 IpadWebServiceTest[10149:207] ResponseStatus: 500
2011-06-10 11:54:05.590 IpadWebServiceTest[10149:207] ResponseHeaders:
{
    "Content-Length" = 615;
    "Content-Type" = "application/soap+xml; charset=utf-8";
    Date = "Fri, 10 Jun 2011 16:54:05 GMT";
    Server = "Microsoft-HTTPAPI/2.0";
}
2011-06-10 11:54:05.591 IpadWebServiceTest[10149:207] ResponseBody:
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action s:mustUnderstand="1">http://www.w3.org/2005/08/addressing/soap/fault</a:Action></s:Header><s:Body><s:Fault><s:Code><s:Value>s:Sender</s:Value><s:Subcode><s:Value>a:DestinationUnreachable</s:Value></s:Subcode></s:Code><s:Reason><s:Text xml:lang="en-US">The message with To '' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher.  Check that the sender and receiver's EndpointAddresses agree.</s:Text></s:Reason></s:Fault></s:Body></s:Envelope>

这是主机app.config

代码语言:javascript
复制
    <services>
        <service 
          behaviorConfiguration="serviceBehavior"
                 name="HelloIndigo.HelloIndigoService">

            <endpoint address="HelloIndigoService"
                      binding="basicHttpBinding"
                      bindingNamespace="FredIannon.TestService"
                      name="basicHttp"
                      contract="HelloIndigo.IHelloIndigoService" />

            <endpoint binding="mexHttpBinding"
                      name="mex"
                      contract="IMetadataExchange" />

            <host>
                <baseAddresses>
                  <add baseAddress="http://192.168.1.69:8000/HelloIndigo/HelloIndigoService" />
<!--                        <add baseAddress="http://localhost:8000/HelloIndigo/HelloIndigoService" />    -->
                </baseAddresses>
            </host>
        </service>
    </services>
EN

回答 1

Stack Overflow用户

发布于 2011-06-10 17:28:56

WCF服务正在接收您的soap,但是它不能正确地解析wsdl2objc代理生成的soap头。这篇文章有一个你遇到的对实际问题有很好的描述。要确定所需的标头,首先创建一个成功调用服务的.NET WCF客户端。通过捕获它发送的soap,了解预期的头应该是什么。修改代理代码以生成作为.NET客户端的确切soap头。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6309736

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档