Jump to content

Recommended Posts

I'm having trouble with an API. I usually send the data to the API using

 

$client = new soapclient_gt($order_url, 'true');

$result = $client->call('QuickOrder',$params);

 

And from that I can simply use variables such as $result->field1 in order to read the response.

 

However from the code I've been given there appears to be a bug in nusoap which means the particular example I'm working on simply fails (I have absolutely no idea what the bug is, but I've tried to call the API using the above format and it does indeed fail to even send the request properly).

 

So, in this example I'm having to build the whole XML file as a variable and send it using

 

$client->send($xml);

 

The problem is that I have no idea how to extract the array from $client->response.

 

If I use print_r($client->response) and then look at the page source, it shows me this :-

I need to create a variable called $success which looks at the value of SuccessCode, in the above example this would be 0.

 

I have run out of google searches so I'm going to pass it onto the experts :)

OK I now have a new version of nusoap, sadly all the functions and syntax is different and the furthest I can get is an error saying :-

 

Array

(

    [faultcode] => env:Server

    [faultstring] => Failed to invoke end component webservice.Order (POJO), operation=ValidateOrderParameters

-> Failed to invoke method

 

    [detail] => Array

        (

            [string] => java.lang.NullPointerException

 

        )

 

)

 

I'm afraid this is all far too complex for me :(

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.