Jump to content

Sending information to a webservice


vr6stress

Recommended Posts

I've run into a snag on a webservice. It's looking for a type of ArrayofString. Bascially it want multiple numbers (bar_code_numbers) to redeem. I swear I had the array built right...but it keeps coming back saying it blank.

 

This is my array that I send.

Array
(
    [parameters] => Array
        (
            [bar_code_numbers] => Array
                (
                    [0] => 000880759302200705
                    [1] => 004893608002200705
                )

            [redeem_branch_nbr] => 3400005
            [redeem_method] => WIFI
            [order_number] => 9434
        )

)

This is the the request that I send.

<RedeemCoupons xmlns="http://www.openuri.org/"><bar_code_numbers><String/></bar_code_numbers><redeem_branch_nbr>3400005</redeem_branch_nbr><redeem_method>WIFI</redeem_method><order_number>9434</order_number></RedeemCoupons>You can see in read that it's blank. The weird thing is, in the debug of it, it shows the codes there.

 

2007-02-26 09:07:50.201922 soapclient: call: operation=RedeemCoupons, namespace=http://tempuri.org, soapAction=, rpcParams=, style=rpc, use=encoded, endpointType=wsdl
params=array(1) {
  ["parameters"]=>
  array(4) {
    ["bar_code_numbers"]=>
    array(2) {
      [0]=>
      string(18) "000880759302200705"
      [1]=>
      string(18) "004893608002200705"
    }
    ["redeem_branch_nbr"]=>
    string(7) "3400005"
    ["redeem_method"]=>
    string(4) "WIFI"
    ["order_number"]=>
    string(4) "9434"
  }
}

This is the part of the WSDL that covers the redemption.

<s:element name="RedeemCoupons">
        <s:complexType>
          <s:sequence>
            <s:element name="bar_code_numbers" type="ope:ArrayOfString" minOccurs="0"/>
            <s:element name="redeem_branch_nbr" type="s:string" minOccurs="0"/>
            <s:element name="redeem_method" type="s:string" minOccurs="0"/>
            <s:element name="order_number" type="s:int"/>
          </s:sequence>
        </s:complexType>
      </s:element>

I guess I'm lost as to why it's not taking these. Is my array built wrong? I'm really struggling on this...

 

This is the result of the soap call I make.

Array
(
    [redeemResult] => Array
        (
            [rowCount] => 0
            [rowResult] => Array
                (
                    [bar_code_number] =>
                    [result] => Blank Barcode Number
                )

        )

)

Link to comment
https://forums.phpfreaks.com/topic/40205-sending-information-to-a-webservice/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.