Jump to content

Soap Web service


LoOpy

Recommended Posts

Im trying to connect to a .net soap web service but im getting nothing back. im running PHP 5.2.3, on IIS. I notice I'm sending some extra code ie ns1:. What do i need to change to get my request to look like the end request?

<?php
$param = array(
	"vbuNumber"	=> "12345",
	"systemID"	=> "ID",
	"username" 	=> "username",
	"password" 	=> "password",
	"errorCode"	=> ""
);


  $client = new SoapClient('http://link?WSDL',array(
   	 "trace"      	=> 1,
   	 "exceptions" 	=> 1));
  try {
    echo "<pre>\n";
    $client->GetVehicleLatestPos( $param );

print "Request :\n".htmlspecialchars($client->__getLastRequest()) ."\n";
  	print "Response:\n".htmlspecialchars($client->__getLastResponse())."\n"; 
    echo "\n</pre>\n";
  } catch (SoapFault $exception) {
    echo $exception;      
  }

?> 

What my request looks like:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://tempuri.org/">
<SOAP-ENV:Body>
<ns1:GetVehicleLatestPos>
<ns1:vbuNumber>12345</ns1:vbuNumber>
<ns1:systemID>ID</ns1:systemID>
<ns1:username>username</ns1:username>
<ns1:password>password</ns1:password>
<ns1:errorCode></ns1:errorCode>
</ns1:GetVehicleLatestPos>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

This is what my request should look like:

<?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>
    <GetVehicleLatestPos xmlns="http://tempuri.org/">
      <vbuNumber>string</vbuNumber>
      <systemID>string</systemID>
      <username>string</username>
      <password>string</password>
      <errorCode>string</errorCode>
    </GetVehicleLatestPos>
  </soap:Body>
</soap:Envelope>

 

What my response looks like:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetVehicleLatestPosResponse xmlns="http://tempuri.org/">
<errorCode />
</GetVehicleLatestPosResponse>
</soap:Body>
</soap:Envelope>

Link to comment
https://forums.phpfreaks.com/topic/104544-soap-web-service/
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.