logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: My first SOAP App, my first problem: msg#00004

Subject: Re: My first SOAP App, my first problem
The most blessed method is to use a soapval to represent the value, such 
as

$val2 = new soapval('order', false, '', false, false, array('type' => 
'PhoneOrder'));
$params = array (
    'val1' => 123,
    'order' => $val2
);
$result = $client->call('the.method', $params);

The shortcut would be to use the '!' prefix (I think):

$val2 = array('!type' => 'PhoneOrder');
$params = array (
    'val1' => 123,
    'order' => $val2
);
$result = $client->call('the.method', $params);

Scott Nichol

----- Original Message ----- 
From: <jpeabody@xxxxxxxxxxxxxxxxx>
To: "'Scott Nichol'" <snicholnews@xxxxxxxxxxxxxxx>
Sent: Wednesday, May 02, 2007 10:52 AM
Subject: RE: [Nusoap-general] My first SOAP App, my first problem


> Thanks for your help earlier with this, it worked.  I have a new 
> problem,
> though, that would seem to be simple but can't find the answer to.  My
> question is how can I create an empty element with an attribute? 
> Along the
> lines of:
> <order type="PhoneOrder" />
>
>
> -----Original Message-----
> From: Scott Nichol [mailto:snicholnews@xxxxxxxxxxxxxxx]
> Sent: Wednesday, April 11, 2007 11:27 AM
> To: jpeabody@xxxxxxxxxxxxxxxxx; nusoap-general@xxxxxxxxxxxxxxxxxxxxx
> Subject: Re: [Nusoap-general] My first SOAP App, my first problem
>
> Ooops.  Sorry for not reading the whole post.
>
> It looks like you have called the Login method without providing
> properly formatted parameters.  My guess is that the service is
> document/literal with wrapped parameters.  NuSOAP needs you to wrap 
> the
> parameters you use when calling.  So, if you think you should do
>
> $params = ('user' => $user, 'password' => $password);
> $result = $client->call('Login', $params);
>
> you may be supposed to do
>
> $params = ('user' => $user, 'password' => $password);
> $result = $client->call('Login', array('parameters' => $params));
>
> The additional array with a single element named 'parameters' is the
> parameter wrapping.
>
> Scott Nichol
>
> ----- Original Message ----- 
> From: <jpeabody@xxxxxxxxxxxxxxxxx>
> To: "'Scott Nichol'" <snicholnews@xxxxxxxxxxxxxxx>
> Sent: Wednesday, April 11, 2007 10:38 AM
> Subject: RE: [Nusoap-general] My first SOAP App, my first problem
>
>
>> Thanks for the response, but I have that.  In the second half of my
>> admittedly long post I explain that I added 'true' as the second
>> argument,
>> but that results in a different fault, this time from the wsdl server
>> because the UserName and Password are not being passed; the Login tag
>> is
>> terminated before it gets to those values.  But SOAPAction is being
>> set.
>>
>> -----Original Message-----
>> From: nusoap-general-bounces@xxxxxxxxxxxxxxxxxxxxx
>> [mailto:nusoap-general-bounces@xxxxxxxxxxxxxxxxxxxxx] On Behalf Of
>> Scott
>> Nichol
>> Sent: Wednesday, April 11, 2007 9:09 AM
>> To: nusoap-general@xxxxxxxxxxxxxxxxxxxxx
>> Subject: Re: [Nusoap-general] My first SOAP App, my first problem
>>
>> The soapclient constructor can be used either to connect directly to 
>> a
>> SOAP endpoint, or to connect to the WSDL and use the endpoint
>> specified
>> within the WSDL.  The second parameter to the constructor determines
>> which of these two it will be.  Since you provide the URL to the 
>> WSDL,
>> you want to specify the second parameter as 'wsdl' or true.
>>
>> $client = new
>>
> soapclient('http://labs.bandwidth.com/BWC.Public.Webservices/voip/v1_0/Numbe
>> rManagementService.asmx?wsdl',
>> 'wsdl');   //per vendor spec
>>
>> Scott Nichol
>> ----- Original Message ----- 
>> From: <jpeabody@xxxxxxxxxxxxxxxxx>
>> To: <nusoap-general@xxxxxxxxxxxxxxxxxxxxx>
>> Sent: Tuesday, April 10, 2007 6:10 PM
>> Subject: [Nusoap-general] My first SOAP App, my first problem
>>
>>
>> <snip>
>>
>>>
>>> The key was it's missing the "SOAPAction".  Then I realized the
>>> instantiation of the new soapclient was missing the WSDL flag, so I
>>> added
>>> 'true' at the end of the line:
>>>
>>>
>>>
>>> $client = new
>>>
>>
> soapclient('http://labs.bandwidth.com/BWC.Public.Webservices/voip/v1_0/Numbe
>>> rManagementService.asmx?wsdl', true);
>>>
>>>
>>>
>>> That got me a new fault.  The SOAPAction was present, but it stopped
>>> passing
>>> in my UserName and Password:
>>>
>>> (
>>>
>>>    [faultcode] => soap:Server
>>>
>>>    [faultstring] => Server was unable to process request. --> Null
>>> UserID
>>> received
>>>
>>>    [detail] =>
>>>
>>> )
>>>
>>>
>>>
>>> Request
>>>
>>> POST /BWC.Public.Webservices/voip/v1_0/NumberManagementService.asmx
>>> HTTP/1.0
>>>
>>> Host: labs.bandwidth.com
>>>
>>> User-Agent: NuSOAP/0.7.2 (1.94)
>>>
>>> Content-Type: text/xml; charset=ISO-8859-1
>>>
>>> SOAPAction: "http://www.bandwidth.com/Login";
>>>
>>> Content-Length: 405
>>>
>>>
>>>
>>> <?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:ns7031="http://tempuri.org";>
>>>
>>>  <SOAP-ENV:Body>
>>>
>>>    <Login xmlns="http://www.bandwidth.com"/>
>>>
>>>  </SOAP-ENV:Body>
>>>
>>> </SOAP-ENV:Envelope>
>>>
>>>
>>>
>>> Response
>>>
>>> HTTP/1.1 500 Internal Server Error.
>>>
>>> Connection: close
>>>
>>> Date: Tue, 10 Apr 2007 21:10:42 GMT
>>>
>>> Server: Microsoft-IIS/6.0
>>>
>>> X-Powered-By: ASP.NET
>>>
>>> X-AspNet-Version: 1.1.4322
>>>
>>> Cache-Control: private
>>>
>>> Content-Type: text/xml; charset=utf-8
>>>
>>> Content-Length: 455
>>>
>>>
>>>
>>> <?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>
>>>
>>>    <soap:Fault>
>>>
>>>      <faultcode>soap:Server</faultcode>
>>>
>>>      <faultstring>Server was unable to process request. --> Null
>>> UserID
>>> received</faultstring>
>>>
>>>      <detail />
>>>
>>>    </soap:Fault>
>>>
>>>  </soap:Body>
>>>
>>> </soap:Envelope>
>>>
>>>
>>>
>>> Something caused the <Login> stanza to be terminated prematurely.
>>> What am I
>>> missing that is keeping me from getting a Request with SOAPAction,
>>> UserName
>>> and Password all together?  I'm using PHP 4.4.4, NuSOAP just
>>> downloaded
>>> today.  Thanks in advance for any help.
>>>
>>>
>>
>>
>>
> ----------------------------------------------------------------------------
>> ----
>>
>>
>>> -------------------------------------------------------------------------
>>> Take Surveys. Earn Cash. Influence the Future of IT
>>> Join SourceForge.net's Techsay panel and you'll get the chance to
>>> share your
>>> opinions on IT & business topics through brief surveys-and earn cash
>>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>>
>>
>>
> ----------------------------------------------------------------------------
>> ----
>>
>>
>>> _______________________________________________
>>> Nusoap-general mailing list
>>> Nusoap-general@xxxxxxxxxxxxxxxxxxxxx
>>> https://lists.sourceforge.net/lists/listinfo/nusoap-general
>>>
>>
>>
>> -------------------------------------------------------------------------
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to
>> share your
>> opinions on IT & business topics through brief surveys-and earn cash
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> _______________________________________________
>> Nusoap-general mailing list
>> Nusoap-general@xxxxxxxxxxxxxxxxxxxxx
>> https://lists.sourceforge.net/lists/listinfo/nusoap-general
>>
>>
>>
>
>
>
> 


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/


<Prev in Thread] Current Thread [Next in Thread>