SOAP 请求的问题

Posted

技术标签:

【中文标题】SOAP 请求的问题【英文标题】:Problems with SOAP request 【发布时间】:2013-02-22 19:25:04 【问题描述】:

我正在尝试通过...将 Siebel CRM 与 SAP 系统集成... 问题是:siebel 生成的 SOAP 请求给了我一个错误,而如果我使用 SOAP UI 生成 SOAP 请求,它工作正常。以下是生成的错误消息和 SOAP 请求

siebel SOAP 请求出错:

CX_ST_MATCH_ELEMENT:.系统预期元素'PiCopyreference'"。(SBL-EAI-04308)

Siebel 生成的 SOAP 请求不成功:-

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <SOAP-ENV:Body>
        <CustomerCreatefromdata1 xmlns="urn:sap-com:document:sap:soap:functions:mc-style">
            <PiCompanydata xmlns="urn:sap-com:document:sap:soap:functions:mc-style"></PiCompanydata>
            <PiCopyreference xmlns="urn:sap-com:document:sap:soap:functions:mc-style">
                <Salesorg xmlns="urn:sap-com:document:sap:soap:functions:mc-style">0001</Salesorg>
                <DistrChan xmlns="urn:sap-com:document:sap:soap:functions:mc-style">01</DistrChan>
                <Division xmlns="urn:sap-com:document:sap:soap:functions:mc-style">01</Division>
                <RefCustmr xmlns="urn:sap-com:document:sap:soap:functions:mc-style">0000000011</RefCustmr>
            </PiCopyreference>
            <PiOptCompanydata xmlns="urn:sap-com:document:sap:soap:functions:mc-style"></PiOptCompanydata>
            <PiOptPersonaldata xmlns="urn:sap-com:document:sap:soap:functions:mc-style">
                <Transpzone xmlns="urn:sap-com:document:sap:soap:functions:mc-style">0000000001</Transpzone>
            </PiOptPersonaldata>
            <PiPersonaldata xmlns="urn:sap-com:document:sap:soap:functions:mc-style">
                <TitleP xmlns="urn:sap-com:document:sap:soap:functions:mc-style">MR</TitleP>
                <Firstname xmlns="urn:sap-com:document:sap:soap:functions:mc-style">FirstN</Firstname>
                <Lastname xmlns="urn:sap-com:document:sap:soap:functions:mc-style">lastN</Lastname>
                <City xmlns="urn:sap-com:document:sap:soap:functions:mc-style">SomeCity</City>
                <PostlCod1 xmlns="urn:sap-com:document:sap:soap:functions:mc-style">7866</PostlCod1>
                <Country xmlns="urn:sap-com:document:sap:soap:functions:mc-style">AT</Country>
                <LanguP xmlns="urn:sap-com:document:sap:soap:functions:mc-style">E</LanguP>
                <Currency xmlns="urn:sap-com:document:sap:soap:functions:mc-style">INR</Currency>
            </PiPersonaldata>
        </CustomerCreatefromdata1>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

成功的 SOAP UI 生成请求:-

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sap-com:document:sap:soap:functions:mc-style">
    <soapenv:Header/>
    <soapenv:Body>
        <urn:CustomerCreatefromdata1>
            <PiCompanydata/>
            <PiCopyreference>
                <Salesorg>0001</Salesorg>
                <DistrChan>01</DistrChan>
                <Division>01</Division>
                <RefCustmr>0000000011</RefCustmr>
            </PiCopyreference>
            <PiOptCompanydata/>
            <PiOptPersonaldata>
                <Transpzone>0000000001</Transpzone>
            </PiOptPersonaldata>
            <PiPersonaldata>
                <TitleP>MR</TitleP>
                <Firstname>FirstN</Firstname>
                <Lastname>lastN</Lastname>
                <City>SomeCity</City>
                <PostlCod1>7866</PostlCod1>
                <Country>AT</Country>
                <LanguP>E</LanguP>
                <Currency>INR</Currency>
            </PiPersonaldata>
        </urn:CustomerCreatefromdata1>
    </soapenv:Body>
</soapenv:Envelope>

还在 siebel 中,我使用工作流生成 SOAP 请求(不涉及脚本)。

【问题讨论】:

【参考方案1】:

可能是命名空间问题。在 Siebel 外部 IO 中,您可以尝试在 ICField 级别停用命名空间的所有用户属性。

【讨论】:

感谢 Ranjith 的提示...我试过了,现在 xmlns 属性没有出现在除 CustomerCreatefromdata1 之外的任何标签中...但问题仍然相同,得到相同的错误消息。即使我从 CustomerCreatefromdata1 标记中手动删除 xmlns 属性也没有变化。 让它工作...停用 XMLTAGNAMESPACE 字段只会使子元素从父元素继承命名空间,同时保持它们处于活动状态并删除值 col。让它工作。

以上是关于SOAP 请求的问题的主要内容,如果未能解决你的问题,请参考以下文章

SOAP 请求的问题。 '访问控制允许来源'

尝试构建正确的 SOAP 请求

SOAP:HTTP 错误请求

SOAP请求PHP

如何在iphone中解析soap请求

NSMutableURLRequest 处理soap请求中的特殊字符