You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by josn <jo...@gmail.com> on 2011/08/08 17:07:50 UTC

error when send soap request to http consumer

Hi,

I am using ServiceMix 3.3.2. I send this soap request to http consumer.

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:tns="http://www.wawj.com/house/loan">
    <env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
        <wsa:To>http://www.wawj.com/house/loan</wsa:To>
        <wsa:MessageID>urn:uuid:1B442BFA45AA53188D1312449275881
        </wsa:MessageID>
        <wsa:Action>urn:queryHouseLoan</wsa:Action>
    </env:Header>
    <env:Body>
        <tns:queryHouseLoan>
            <tns:houseLoanRequest>
                <tns:ssn>191912651666793069</tns:ssn>
                <tns:realEstate>sss</tns:realEstate>
                <tns:no>2#302</tns:no>
                <tns:area>97.5</tns:area>
                <tns:price>500000</tns:price>
                <tns:firstPay>50000</tns:firstPay>
                <tns:amount>60000</tns:amount>
                <tns:duration>25</tns:duration>
            </tns:houseLoanRequest>
        </tns:queryHouseLoan>
    </env:Body>
</env:Envelope>

I got a fault response

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
  <env:Body>
    <env:Fault>
      <faultcode>env:Server</faultcode>
      <faultstring>java.lang.IllegalArgumentException: Bad syntax: expected
[part0][sep][part1][sep][part2]</faultstring>
    </env:Fault>
  </env:Body>
</env:Envelope>


but when I delete the content between  <env:Header>…</env:Header>

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:tns="http://www.wawj.com/house/loan">
    <env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
        <wsa:To>http://www.wawj.com/house/loan</wsa:To>
        <wsa:MessageID>urn:uuid:1B442BFA45AA53188D1312449275881
        </wsa:MessageID>
        <wsa:Action>urn:queryHouseLoan</wsa:Action>
    </env:Header>
    <env:Body>
        <tns:queryHouseLoan>
            <tns:houseLoanRequest>
                <tns:ssn>191912651666793069</tns:ssn>
                <tns:realEstate>sss</tns:realEstate>
                <tns:no>2#302</tns:no>
                <tns:area>97.5</tns:area>
                <tns:price>500000</tns:price>
                <tns:firstPay>50000</tns:firstPay>
                <tns:amount>60000</tns:amount>
                <tns:duration>25</tns:duration>
            </tns:houseLoanRequest>
        </tns:queryHouseLoan>
    </env:Body>
</env:Envelope>

I got correct response.

Any help?

Best wishes,

-
josn

Re: error when send soap request to http consumer

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

Could you use cxf bc consumer instead? It's better for soap/ws- 
addressing support.

Freeman
On 2011-8-8, at 下午11:07, josn wrote:

> Hi,
>
> I am using ServiceMix 3.3.2. I send this soap request to http  
> consumer.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
>    xmlns:tns="http://www.wawj.com/house/loan">
>    <env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
>        <wsa:To>http://www.wawj.com/house/loan</wsa:To>
>        <wsa:MessageID>urn:uuid:1B442BFA45AA53188D1312449275881
>        </wsa:MessageID>
>        <wsa:Action>urn:queryHouseLoan</wsa:Action>
>    </env:Header>
>    <env:Body>
>        <tns:queryHouseLoan>
>            <tns:houseLoanRequest>
>                <tns:ssn>191912651666793069</tns:ssn>
>                <tns:realEstate>sss</tns:realEstate>
>                <tns:no>2#302</tns:no>
>                <tns:area>97.5</tns:area>
>                <tns:price>500000</tns:price>
>                <tns:firstPay>50000</tns:firstPay>
>                <tns:amount>60000</tns:amount>
>                <tns:duration>25</tns:duration>
>            </tns:houseLoanRequest>
>        </tns:queryHouseLoan>
>    </env:Body>
> </env:Envelope>
>
> I got a fault response
>
> <?xml version="1.0" encoding="UTF-8"?>
> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
>  <env:Body>
>    <env:Fault>
>      <faultcode>env:Server</faultcode>
>      <faultstring>java.lang.IllegalArgumentException: Bad syntax:  
> expected
> [part0][sep][part1][sep][part2]</faultstring>
>    </env:Fault>
>  </env:Body>
> </env:Envelope>
>
>
> but when I delete the content between  <env:Header>…</env:Header>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
>    xmlns:tns="http://www.wawj.com/house/loan">
>    <env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
>        <wsa:To>http://www.wawj.com/house/loan</wsa:To>
>        <wsa:MessageID>urn:uuid:1B442BFA45AA53188D1312449275881
>        </wsa:MessageID>
>        <wsa:Action>urn:queryHouseLoan</wsa:Action>
>    </env:Header>
>    <env:Body>
>        <tns:queryHouseLoan>
>            <tns:houseLoanRequest>
>                <tns:ssn>191912651666793069</tns:ssn>
>                <tns:realEstate>sss</tns:realEstate>
>                <tns:no>2#302</tns:no>
>                <tns:area>97.5</tns:area>
>                <tns:price>500000</tns:price>
>                <tns:firstPay>50000</tns:firstPay>
>                <tns:amount>60000</tns:amount>
>                <tns:duration>25</tns:duration>
>            </tns:houseLoanRequest>
>        </tns:queryHouseLoan>
>    </env:Body>
> </env:Envelope>
>
> I got correct response.
>
> Any help?
>
> Best wishes,
>
> -
> josn

---------------------------------------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com