wsdl错误:标题和文档没有正确分离 [英] wsdl error: no proper separation of headers and document
问题描述
我正在使用NUSOAP将肥皂接口用于microsoftdynamics。我收到此错误 wsdl错误:正在获取 https: //testserver2013.api.crm4.dynamics.com/XRMServices/2011/Organization.svc?wsdl=wsdl0 -HTTP错误:标头和文档之间没有适当的分隔,我有些困惑。
I'm using NUSOAP to use a soap interface to microsoftdynamics. I'm getting this error "wsdl error: Getting https://testserver2013.api.crm4.dynamics.com/XRMServices/2011/Organization.svc?wsdl=wsdl0 - HTTP ERROR: no proper separation of headers and document" , I'm a bit confused.
我假设xml文档很好,标题是否有问题,或者我可能读错了它!
I'm assuming the xml document is fine, is there a problem with the headers, or is it likely i'm incorrectly reading it! thanks.
文档的xml如下
<ms-xrm:FailoverPolicy xmlns:ms-xrm="http://schemas.microsoft.com/xrm/2012/Contracts/Services">
<ms-xrm:FailoverAvailable>false</ms-xrm:FailoverAvailable>
<ms-xrm:EndpointEnabled>true</ms-xrm:EndpointEnabled>
</ms-xrm:FailoverPolicy>
<ms-xrm:AuthenticationPolicy xmlns:ms-xrm="http://schemas.microsoft.com/xrm/2011/Contracts/Services">
<ms-xrm:Authentication>LiveId</ms-xrm:Authentication>
<ms-xrm:SecureTokenService>
<ms-xrm:Identifier>urn:federation:MicrosoftOnline</ms-xrm:Identifier>
<ms-xrm:LiveTrust>
<ms-xrm:AppliesTo>urn:crmemea:dynamics.com</ms-xrm:AppliesTo>
<ms-xrm:TrustVersion>WSTrustFeb2005</ms-xrm:TrustVersion>
<ms-xrm:SecurityMode>TransportWithMessageCredential</ms-xrm:SecurityMode>
<ms-xrm:LivePolicy>MBI_FED_SSL</ms-xrm:LivePolicy>
<ms-xrm:LiveIdAppliesTo>http://Passport.NET/tb</ms-xrm:LiveIdAppliesTo>
</ms-xrm:LiveTrust>
</ms-xrm:SecureTokenService>
</ms-xrm:AuthenticationPolicy>
<ms-xrm:FailoverPolicy xmlns:ms-xrm="http://schemas.microsoft.com/xrm/2012/Contracts/Services">
<ms-xrm:FailoverAvailable>false</ms-xrm:FailoverAvailable>
<ms-xrm:EndpointEnabled>true</ms-xrm:EndpointEnabled>
</ms-xrm:FailoverPolicy>
<ms-xrm:AuthenticationPolicy xmlns:ms-xrm="http://schemas.microsoft.com/xrm/2012/Contracts/Services">
<ms-xrm:Authentication>OnlineFederation</ms-xrm:Authentication>
<ms-xrm:SecureTokenService>
<ms-xrm:Identifier>https://dynamicscrmemea.accesscontrol.windows.net/</ms-xrm:Identifier>
<ms-xrm:OrgTrust>
<ms-xrm:AppliesTo>urn:crmemea:dynamics.com</ms-xrm:AppliesTo>
<ms-xrm:TrustVersion>WSTrustFeb2005</ms-xrm:TrustVersion>
<ms-xrm:SecurityMode>TransportWithMessageCredential</ms-xrm:SecurityMode>
<ms-xrm:LivePolicy>MBI_FED_SSL</ms-xrm:LivePolicy>
<ms-xrm:LiveIdAppliesTo>http://Passport.NET/tb</ms-xrm:LiveIdAppliesTo>
<ms-xrm:LiveEndpoint>https://login.microsoftonline.com/RST2.srf</ms-xrm:LiveEndpoint>
<ms-xrm:Identifier>urn:federation:MicrosoftOnline</ms-xrm:Identifier>
</ms-xrm:OrgTrust>
</ms-xrm:SecureTokenService>
</ms-xrm:AuthenticationPolicy>
<ms-xrm:FailoverPolicy xmlns:ms-xrm="http://schemas.microsoft.com/xrm/2012/Contracts/Services">
<ms-xrm:FailoverAvailable>false</ms-xrm:FailoverAvailable>
<ms-xrm:EndpointEnabled>true</ms-xrm:EndpointEnabled>
</ms-xrm:FailoverPolicy>
<sp:TransportBinding xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
<wsp:Policy>
<sp:TransportToken>
<wsp:Policy>
<sp:HttpsToken/>
</wsp:Policy>
</sp:TransportToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:TripleDes/>
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict/>
</wsp:Policy>
</sp:Layout>
<sp:IncludeTimestamp/>
</wsp:Policy>
</sp:TransportBinding>
<sp:SignedSupportingTokens xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
<wsp:Policy>
<sp:IssuedToken sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
<Issuer xmlns="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
<Address xmlns="http://www.w3.org/2005/08/addressing">https://login.microsoftonline.com/RST2.srf</Address>
<Metadata xmlns="http://www.w3.org/2005/08/addressing">
<Metadata xmlns="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<wsx:MetadataSection xmlns="">
<wsx:MetadataReference>
<Address xmlns="http://www.w3.org/2005/08/addressing">https://dynamicscrmemea.accesscontrol.windows.net/v2/wstrust/mex</Address>
</wsx:MetadataReference>
</wsx:MetadataSection>
</Metadata>
</Metadata>
</Issuer>
<sp:RequestSecurityTokenTemplate>
<trust:KeyType xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512">http://docs.oasis-open.org/ws-sx/ws-trust/200512/SymmetricKey</trust:KeyType>
<trust:KeySize xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512">192</trust:KeySize>
<trust:Claims Dialect="http://schemas.xmlsoap.org/ws/2005/05/identity" xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512">
<wsid:ClaimType Uri="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier" xmlns:wsid="http://schemas.xmlsoap.org/ws/2005/05/identity"/>
</trust:Claims>
<trust:KeyWrapAlgorithm xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512">http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p</trust:KeyWrapAlgorithm>
<trust:EncryptWith xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512">http://www.w3.org/2001/04/xmlenc#tripledes-cbc</trust:EncryptWith>
<trust:SignWith xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512">http://www.w3.org/2000/09/xmldsig#hmac-sha1</trust:SignWith>
<trust:CanonicalizationAlgorithm xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512">http://www.w3.org/2001/10/xml-exc-c14n#</trust:CanonicalizationAlgorithm>
<trust:EncryptionAlgorithm xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512">http://www.w3.org/2001/04/xmlenc#tripledes-cbc</trust:EncryptionAlgorithm>
</sp:RequestSecurityTokenTemplate>
<wsp:Policy>
<sp:RequireInternalReference/>
</wsp:Policy>
</sp:IssuedToken>
</wsp:Policy>
</sp:SignedSupportingTokens>
<sp:Wss11 xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
<wsp:Policy/>
</sp:Wss11>
<sp:Trust13 xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
<wsp:Policy>
<sp:MustSupportIssuedTokens/>
<sp:RequireClientEntropy/>
<sp:RequireServerEntropy/>
</wsp:Policy>
</sp:Trust13>
<wsaw:UsingAddressing/>
</wsp:All>
</wsp:ExactlyOne>
任何想法,谢谢!或任何有关Microsoft Dynamics CRM Online 2011的有效教程都很棒!
any ideas, thank! or any good working tutorials on microsoft dynamics crm online 2011 would be great!
谢谢!
推荐答案
我刚刚看到此错误,它似乎是nusoap代码中的错误。在我们的案例中,这是由于对SOAP调用的401错误响应引起的,但301和302响应似乎触发了相同的问题。
I just saw this error and it appears to be a bug in the nusoap code. In our case this was caused by a 401 error response to the SOAP call but 301 and 302 responses would appear to trigger the same issue.
该错误似乎在以下代码行:
The bug appears to be in the following line of code:
if($ pos = strpos($ data, \r\n\r\n))
if ($pos = strpos($data,"\r\n\r\n"))
剥离标头时,$ pos设置为0,其值为FALSE,而开发人员打算将标头保持原样的情况下评估为TRUE。
When headers were stripped $pos is set to 0 and this evaluates to FALSE whereas it appears the developer intended it to evaluate to TRUE along with the case where the headers are intact.
请参阅:
https://github.com/codecasts/nusoap-php7/blob/master/lib/class.soap_transport_http.php
这篇关于wsdl错误:标题和文档没有正确分离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!