Topic: newbsoap and PHP (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=29483" title="Pages that link to Topic: newbsoap and PHP (Page 1 of 1)" rel="nofollow" >Topic: newbsoap and PHP <span class="small">(Page 1 of 1)</span>\

 
Red Ninja
Bipolar (III) Inmate

From: Detroit, MI US
Insane since: Mar 2001

posted posted 08-29-2007 13:41

Hey all,

I'm trying to write a script for osCommerce that goes to a company that uses an API with SOAP to receive orders. Only problem is I have no idea how to use soap. I get an error "SOAP-ENV:Server: service 'http://tempuri.org' unknown". I'm guessing that is something to do with the namespace. But what I don't know is if the default namespace in nusoap won't work, what, then, should I be replacing it with? The API techs are no help as they haven't called me back and there is NOTHING in the documentation regarding this.


In case anyone needs it:

<?php
require_once('./nusoap/nusoap.php');

$c = new soapclient('https://api-test.newvinelogistics.com:443/soap/servlet/rpcrouter');
$c->setCredentials('nvltest','Nv1T35t','basic');
$xml = array(
'customerID'=>'1095'
);

echo "<pre>";
print_r($c);
echo "</pre>";


$username = ____;
$password = ____;
$soaphost = 'api-test.newvinelogistics.com';
$rpcrouter = 'soap/servlet/rpcrouter';
$soapurl = "https://$soaphost/$rpcrouter";

$remote_method = 'getOrders';
$service_name = 'urn:OrderStatus';
$input_parameter = 'customerOrderInfo';
$es_method = 'http://xml.apache.org/xml-soap/literalxml';
$es_input = 'http://xml.apache.org/xml-soap/literalxml';

$timeout = '30';


# Set parameters
$parameters = array(
'name'=>$input_parameter,
'value' => $xml,
'type' => 'xds:string',
'encodingStyle' => $es_input
);

$parameters2 = array(
'name' => $remote_method,
'uri' => $service_name,
'encodingStyle' => $es_method
);

$stuff= $c->call($soapurl,
$parameters);
$err = $c->getError();

if ($err)
{
print_r($err);
}
echo "<pre>";
print_r($stuff);
echo "</pre>";

?>

Thanks


Edit TP: Removed your passwords... please repost the schema you get from the server, then we'd might be able to help.

(Edited by Tyberius Prime on 08-29-2007 13:48)

Edit RN: They're for a test server anyway and it's all very public. :-D

(Edited by Red Ninja on 08-29-2007 15:35)

Red Ninja
Bipolar (III) Inmate

From: Detroit, MI US
Insane since: Mar 2001

posted posted 08-29-2007 15:37

All righty. Output as follows:


soapclient Object
(
[title] => NuSOAP
[version] => 0.7.2
[revision] => $Revision: 1.94 $
[error_str] =>
[debug_str] => 2007-08-29 08:36:04.793528 soapclient: instantiate SOAP with endpoint at https://api-test.newvinelogistics.com:443/soap/servlet/rpcrouter

[charencoding] => 1
[debugLevel] => 9
[XMLSchemaVersion] => http://www.w3.org/2001/XMLSchema
[soap_defencoding] => ISO-8859-1
[namespaces] => Array
(
[SOAP-ENV] => http://schemas.xmlsoap.org/soap/envelope/
[xsd] => http://www.w3.org/2001/XMLSchema
[xsi] => http://www.w3.org/2001/XMLSchema-instance
[SOAP-ENC] => http://schemas.xmlsoap.org/soap/encoding/
)

[usedNamespaces] => Array
(
)

[typemap] => Array
(
[http://www.w3.org/2001/XMLSchema] => Array
(
[string] => string
[boolean] => boolean
[float] => double
[double] => double
[decimal] => double
[duration] =>
[dateTime] => string
[time] => string
[date] => string
[gYearMonth] =>
[gYear] =>
[gMonthDay] =>
[gDay] =>
[gMonth] =>
[hexBinary] => string
[base64Binary] => string
[anyType] => string
[anySimpleType] => string
[normalizedString] => string
[token] => string
[language] =>
[NMTOKEN] =>
[NMTOKENS] =>
[Name] =>
[NCName] =>
[ID] =>
[IDREF] =>
[IDREFS] =>
[ENTITY] =>
[ENTITIES] =>
[integer] => integer
[nonPositiveInteger] => integer
[negativeInteger] => integer
[long] => integer
[int] => integer
[short] => integer
[byte] => integer
[nonNegativeInteger] => integer
[unsignedLong] =>
[unsignedInt] =>
[unsignedShort] =>
[unsignedByte] =>
[positiveInteger] =>
)

[http://www.w3.org/2000/10/XMLSchema] => Array
(
[i4] =>
[int] => integer
[boolean] => boolean
[string] => string
[double] => double
[float] => double
[dateTime] => string
[timeInstant] => string
[base64Binary] => string
[base64] => string
[ur-type] => array
)

[http://www.w3.org/1999/XMLSchema] => Array
(
[i4] =>
[int] => integer
[boolean] => boolean
[string] => string
[double] => double
[float] => double
[dateTime] => string
[timeInstant] => string
[base64Binary] => string
[base64] => string
[ur-type] => array
)

[http://soapinterop.org/xsd] => Array
(
[SOAPStruct] => struct
)

[http://schemas.xmlsoap.org/soap/encoding/] => Array
(
[base64] => string
[array] => array
[Array] => array
)

[http://xml.apache.org/xml-soap] => Array
(
[0] => Map
)

)

[xmlEntities] => Array
(
[quot] => "
[amp] => &
[lt] => <
[gt] => >
[apos] => '
)

[username] => nvltest
[password] => Nv1T35t
[authtype] => basic
[certRequest] => Array
(
)

[requestHeaders] =>
[responseHeaders] =>
[document] =>
[endpoint] => https://api-test.newvinelogistics.com:443/soap/servlet/rpcrouter
[forceEndpoint] =>
[proxyhost] =>
[proxyport] =>
[proxyusername] =>
[proxypassword] =>
[xml_encoding] =>
[http_encoding] =>
[timeout] => 0
[response_timeout] => 30
[endpointType] => soap
[persistentConnection] =>
[defaultRpcParams] =>
[request] =>
[response] =>
[responseData] =>
[cookies] => Array
(
)

[decode_utf8] => 1
[operations] => Array
(
)

[fault] =>
[faultcode] =>
[faultstring] =>
[faultdetail] =>
)

SOAP-ENV:Client: parsing error: org.xml.sax.SAXParseException: Element type "ns1302:https" must be followed by either attribute specifications, ">" or "/>".

Array
(
[faultcode] => SOAP-ENV:Client
[faultstring] => parsing error: org.xml.sax.SAXParseException: Element type "ns1302:https" must be followed by either attribute specifications, ">" or "/>".
[faultactor] => /soap/servlet/rpcrouter
)

Red Ninja
Bipolar (III) Inmate

From: Detroit, MI US
Insane since: Mar 2001

posted posted 08-29-2007 15:40

Ok, so I've made some changes. I was using their example for perl with soap::lite and trying to apply it to nusoap and that obviously doesn't work. So I changed the first variable in the call to just the soapurl and it did something...



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu