Unfortunately, given the way the service is implemented, I think your code will
have to create the XML string each time. There might be a way to use methods
from the nusoap_base or wsdl classes to create the string from an array of
"parameters", but I think it will be faster and easier to generate the correct
string if you write your own code to do so.
Scott Nichol
Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message -----
From: "Jörgen Nilsson" <jorgen.nilsson@xxxxxxxxx>
To: <nusoap-general@xxxxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, December 06, 2005 1:03 PM
Subject: Re: [Nusoap-general] Soap structure problems
Hey Scott!
Thanks for the reply.
That's the problem. I can't really post the link to the WSDL
dokument, since I don't know how the company that built the
webservice would react. Could come down to some legal issues or just
nothing to worry about. Here is the copy and paste form just looking
at the asmx file in Safari browser. I have no idea if this helps or
not. I have removed the Post and host sections from the SOAP header.
The webservice is very strangly built I think. The only method that
can be called is InvokeService and then the actual method call is
done in the <Service>-tag like <Service Name="methodname">Various
tags with parameters</Service>. The only way to get the web service
to work properly is to send in an xml-string and this is just fine if
it is a small call. But some of the methods requires sometimes as
much as 20 parameters and that is a lot of xml-tags to write and I
find it difficult to create the xml-tree dynamiclly everytime.
Best regards
Jörgen Nilsson
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/InvokeService"
<?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>
<InvokeService xmlns="http://tempuri.org/">
<serviceData>string</serviceData>
</InvokeService>
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?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>
<InvokeServiceResponse xmlns="http://tempuri.org/">
<InvokeServiceResult />
</InvokeServiceResponse>
</soap:Body>
</soap:Envelope>
SOAP 1.2
The following is a sample SOAP 1.2 request and response. The
placeholders shown need to be replaced with actual values.
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<InvokeService xmlns="http://tempuri.org/">
<serviceData>string</serviceData>
</InvokeService>
</soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<InvokeServiceResponse xmlns="http://tempuri.org/">
<InvokeServiceResult />
</InvokeServiceResponse>
</soap12:Body>
</soap12:Envelope>
On 6 dec 2005, at 18.11, Scott Nichol wrote:
> Is
>
> $soapclient = new soapclient('xxx');
>
> actually
>
> $soapclient = new soapclient('xxx', true);
>
> I am guessing it is, and that you get "Array" instead of a
> serialized array because the format of the parameters you are
> providing does not exactly match the WSDL. Can you post the WSDL?
>
> Scott Nichol
>
> Do not send e-mail directly to this e-mail address,
> because it is filtered to accept only mail from
> specific mail lists.
> ----- Original Message -----
> From: "Jörgen Nilsson" <jorgen.nilsson@xxxxxxxxx>
> To: <nusoap-general@xxxxxxxxxxxxxxxxxxxxx>
> Sent: Monday, December 05, 2005 10:14 AM
> Subject: [Nusoap-general] Soap structure problems
>
>
> Hey!
>
> I have tried for quite a while now to get the right formatting for
> call / send the xml sructure below. But I just can't do it. I get the
> first elements right, but I always get an "Array" (See soap query
> below) in the middle. Is there anyone more experienced NuSoap user
> who can help me with this?
>
> Best regards
> Jörgen
>
> The structure I want to send
> ----------------------------------------------------------------------
> --
> -------------
> <serviceData xmlns="http://tempuri.org/">
> <Service Name="Test">
> <Parameters>
> <ActorId>7</ActorId>
> <Password>testPAss</Password>
> <Address1>Smith street</Address1>
> </Parameters>
> <Culture>En</Culture>
> </Service>
> </serviceData>
>
> My code
> ----------------------------------------------------------------------
> --
> --------------
> require_once('nusoap/lib/nusoap.php');
>
> $soapclient = new soapclient('xxx');
>
> $err = $soapclient->getError();
> if ($err) { print '<h2>Constructor error</h2><pre>' . $err . '</
> pre>'; }
>
>
> $Parameters = array("ActorId" => "7", "Password" => "testPass",
> "Address1" => "Smith street");
>
> $Service = array("Parameters" => $Parameters);
>
> $serviceData = array("Service" => $Service);
>
> $data = array("serviceData" => $serviceData);
>
> $result = $soapclient->call("InvokeService", array("parameters" =>
> $data));
>
> The soap query
> ----------------------------------------------------------------------
> --
> ---------------
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/
> envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-
> ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns6203="http://
> tempuri.org">
> <SOAP-ENV:Body>
> <InvokeService xmlns="http://tempuri.org/">
> <serviceData>Array</serviceData>
> </InvokeService>
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through
> log files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD
> SPLUNK!
> http://ads.osdn.com/?ad_idv37&alloc_id865&op=ick
> _______________________________________________
> Nusoap-general mailing list
> Nusoap-general@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/nusoap-general
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through
> log files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD
> SPLUNK!
> http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
> _______________________________________________
> Nusoap-general mailing list
> Nusoap-general@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/nusoap-general
>
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=ick
_______________________________________________
Nusoap-general mailing list
Nusoap-general@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/nusoap-general
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
|
Try Searching:
servers, voip, java, networking, microsoft ...
|
|
|
|