WSO2 SOAP请求

huangapple go评论43阅读模式
英文:

WSO2 SOAP reqest

问题

我向微服务发送了SOAP请求,响应如下。

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
        <soapenv:Fault>
            <faultcode xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">SOAP-ENV:Client</faultcode>
            <faultstring>An error was detected in the Web Service request. (10894)</faultstring>
            <detail>
                <ns1:FaultDetail xmlns:ns1="urn:soap-fault:details">
                    <errorMessage>Error in SOAP Envelope: Content length must be specified. (10913)</errorMessage>
                    <requestID>----</requestID>
                </ns1:FaultDetail>
            </detail>
        </soapenv:Fault>
    </soapenv:Body>
</soapenv:Envelope>

我在payloadFactory中创建了SOAP信封。

<payloadFactory description="Set ARGS for CALL" media-type="xml">
    <format>
        <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope" xmlns:urn="urn:xyz:zyz">
            <soapenv:Header/>
            <soapenv:Body>
                ...
            </soapenv:Body>
        </soapenv:Envelope>
    </format>
    <args>
        ...
    </args>
</payloadFactory>

然后,我将其发送到微服务。微服务使用SOAP 1.1。我没有附加内容长度,因为我不知道如何附加。

英文:

I'm send soap reqest to microservice and in respond I get this.

&lt;soapenv:Envelope xmlns:soapenv=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;
    &lt;soapenv:Body&gt;
        &lt;soapenv:Fault&gt;
            &lt;faultcode xmlns:SOAP-ENV=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;SOAP-ENV:Client&lt;/faultcode&gt;
            &lt;faultstring&gt;An error was detected in the Web Service request. (10894)&lt;/faultstring&gt;
            &lt;detail&gt;
                &lt;ns1:FaultDetail xmlns:ns1=&quot;urn:soap-fault:details&quot;&gt;
                    &lt;errorMessage&gt;Error in SOAP Envelope: Content length must be specified. (10913)&lt;/errorMessage&gt;
                    &lt;requestID&gt;----&lt;/requestID&gt;
                &lt;/ns1:FaultDetail&gt;
            &lt;/detail&gt;
        &lt;/soapenv:Fault&gt;
    &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;

I create my soap envelope in payloadFactory.

&lt;payloadFactory description=&quot;Set ARGS for CALL&quot; media-type=&quot;xml&quot;&gt;
        &lt;format&gt;
            &lt;soapenv:Envelope xmlns:soapenv=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:urn=&quot;urn:xyz:zyz&quot;&gt;
                &lt;soapenv:Header/&gt;
                &lt;soapenv:Body&gt;
                    ...
                &lt;/soapenv:Body&gt;
            &lt;/soapenv:Envelope&gt;
        &lt;/format&gt;
        &lt;args&gt;
            ...
        &lt;/args&gt;
    &lt;/payloadFactory&gt;

Next I send this to microservice. Micro service work on SOAP 1.1. I'm don't attach content lenght because I do not know how.

答案1

得分: 0

在PL工厂之后,在发送请求之前,请尝试设置以下属性。

<property name="DISABLE_CHUNKING" value="true" scope="axis2" />
<property name="messageType" value="text/xml" scope="axis2" type="STRING"/>
英文:

After the PL factory and before sending the request try setting the following properties.

&lt;property name=&quot;DISABLE_CHUNKING&quot; value=&quot;true&quot; scope=&quot;axis2&quot; /&gt;
&lt;property name=&quot;messageType&quot; value=&quot;text/xml&quot; scope=&quot;axis2&quot; type=&quot;STRING&quot;/&gt;

huangapple
  • 本文由 发表于 2023年2月16日 18:09:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/75470697.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定