12 Replies - 1886 Views - Last Post: 13 March 2013 - 02:31 PM Rate Topic: -----

#1 baxter111  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 77
  • Joined: 30-June 08

SoapClient

Posted 13 March 2013 - 04:16 AM

Hi Guys,

I'm trying to request a soap request but keep getting an error.

This is what the SOAPXML is expecting:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <VehicleSearch xmlns="ServiceBookingComponent">
      <VehicleSearchDetails ClassVersion="string">
        <Identification>
          <SchemeOperatorRef>string</SchemeOperatorRef>
          <SchemeRef>string</SchemeRef>
          <SecurityToken>string</SecurityToken>
          <SystemUserID>string</SystemUserID>
          <SystemAccessCode>string</SystemAccessCode>
          <MicrositePlusPinNo>string</MicrositePlusPinNo>
        </Identification>
        <RegNo>string</RegNo>
      </VehicleSearchDetails>
    </VehicleSearch>
  </soap:Body>
</soap:Envelope>



I've got my request setup like this but it isn't working, I keep getting an error:

$res = $client->VehicleSearch(array('SchemeOperatorRef'=>'61','SecurityToken'=>'MYTOKEN','RegNo'=>'MM1'));



Can anyone shed any light on this?

Thanks,

Scott

Is This A Good Question/Topic? 0
  • +

Replies To: SoapClient

#2 Atli  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 3718
  • View blog
  • Posts: 5,990
  • Joined: 08-June 10

Re: SoapClient

Posted 13 March 2013 - 04:29 AM

Hey Scott.

It's not that I don't like a good challenge on occasion, but if you want our help, we'd appreciate it if you didn't withhold crucial clues like error messages.
Was This Post Helpful? 0
  • +
  • -

#3 baxter111  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 77
  • Joined: 30-June 08

Re: SoapClient

Posted 13 March 2013 - 06:56 AM

haha sorry Atli,

Here is the error message:

stdClass Object
(
    [VehicleSearchResult] => stdClass Object
        (
            [Status] => stdClass Object
                (
                    [Code] => ERROR
                    [Desc] => (Ref. uksn-2002785)
                )

            [VehicleCount] => 0
            [ClassVersion] => 1.0
        )

)
1.0


Was This Post Helpful? 0
  • +
  • -

#4 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6062
  • View blog
  • Posts: 23,513
  • Joined: 23-August 08

Re: SoapClient

Posted 13 March 2013 - 07:54 AM

The expected request suggests to me that your passed data should be wrapped in an 'Identification' array, like this:

$res = $client->VehicleSearch(
    array(
        'Identification' => array(
            'SchemeOperatorRef'=>'61',
            'SecurityToken'=>'MYTOKEN',
            'RegNo'=>'MM1'
        )
    );



SOAP is much easier to debug when you control both sides of the transaction. Which is just one of the many reasons why it sucks.
Was This Post Helpful? 0
  • +
  • -

#5 baxter111  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 77
  • Joined: 30-June 08

Re: SoapClient

Posted 13 March 2013 - 08:10 AM

Thanks for the reply.

Unfortunately I'm still getting the error...

Any other ideas?
Was This Post Helpful? 0
  • +
  • -

#6 Atli  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 3718
  • View blog
  • Posts: 5,990
  • Joined: 08-June 10

Re: SoapClient

Posted 13 March 2013 - 08:28 AM

The RegNo value should probably be outside the Identification array. It is, at least, in the XML you posted. You also seem to be missing a few fields there. Are you sure they are optional?
Was This Post Helpful? 0
  • +
  • -

#7 baxter111  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 77
  • Joined: 30-June 08

Re: SoapClient

Posted 13 March 2013 - 08:32 AM

Yea, I've been told they are not needed...

When I pass them through CURL they seem to work Ok.

This is the latest but still getting the error:

$res = $client->VehicleSearch(array('Identification' => array('SchemeOperatorRef'=>'61', 'SecurityToken'=>'MYKEY'), 'RegNo'=>'MM1'));


Was This Post Helpful? 0
  • +
  • -

#8 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6062
  • View blog
  • Posts: 23,513
  • Joined: 23-August 08

Re: SoapClient

Posted 13 March 2013 - 08:45 AM

Perhaps you might talk to the provider's support with this:

Ref. uksn-2002785)
?
Was This Post Helpful? 0
  • +
  • -

#9 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6062
  • View blog
  • Posts: 23,513
  • Joined: 23-August 08

Re: SoapClient

Posted 13 March 2013 - 09:00 AM

Another thing you might try to do is make use of the __getLastRequest() method so you can actually see what you're sending.
Was This Post Helpful? 1
  • +
  • -

#10 baxter111  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 77
  • Joined: 30-June 08

Re: SoapClient

Posted 13 March 2013 - 09:17 AM

I'm using this and nothing is showing:

echo "REQUEST:\n" . htmlentities($client->__getLastRequest()) . "\n";


Was This Post Helpful? 0
  • +
  • -

#11 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6062
  • View blog
  • Posts: 23,513
  • Joined: 23-August 08

Re: SoapClient

Posted 13 March 2013 - 09:26 AM

Sigh...did you read the manual page to which I linked? Specifically the Notes?
Was This Post Helpful? 0
  • +
  • -

#12 baxter111  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 77
  • Joined: 30-June 08

Re: SoapClient

Posted 13 March 2013 - 09:51 AM

Yea I've added the trace but it didn't work neither...

Here is the code:

$client = new SoapClient("https://mydomain.asmx?WSDL", array('trace' => 1));



Chrome was hiding the response...

It looks like nothing is being sent:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="OneLink_ServiceBookingComponent"><SOAP-ENV:Body><ns1:VehicleSearch/></SOAP-ENV:Body></SOAP-ENV:Envelope>


Was This Post Helpful? 0
  • +
  • -

#13 baxter111  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 77
  • Joined: 30-June 08

Re: SoapClient

Posted 13 March 2013 - 02:31 PM

Does any body know why this is happening?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1