Re: nuSoap client SOAP Call problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Fri, 24 Aug 2007 13:55:29 +0200, Angelo Zanetti <angelo@xxxxxxxxxxxx> wrote:
> 
> 
> Thijs Lensselink wrote:
>> On Fri, 24 Aug 2007 12:39:06 +0200, Angelo Zanetti <angelo@xxxxxxxxxxxx>
> wrote:
>>
>>> Thijs Lensselink wrote:
>>>
>>>> On Fri, 24 Aug 2007 11:53:12 +0200, Angelo Zanetti
> <angelo@xxxxxxxxxxxx>
>>>>
>>> wrote:
>>>
>>>>>> It's probably better to ask on a NuSOAP list.
>>>>>>
>>>>>> The call method needs an array with parameters as far as i remember.
>>>>>> But i never use the call method anyway. I always go for the send
>>>>>>
>>> method.
>>>
>>>>>> First create your request XML.
>>>>>>
>>>>>> $request = '<SubscriptionStatus xmlns='http://localhost/'>
>>>>>> 	<ISPID>xx</ISPID>
>>>>>> 	<ISPPassword>yy</ISPPassword>
>>>>>> 	<ISPUserID>Angelo1</ISPUserID>
>>>>>> </SubscriptionStatus>';
>>>>>>
>>>>>> Then serialize the envelope so it looks like a SOAP request.
>>>>>>
>>>>>> $msg = $client->serializeEnvelope($request, false, false,
> 'document',
>>>>>>
>>>>>>
>>>>> 'literal');
>>>>>
>>>>>
>>>>>> And use the send method to make a connection and send the request.
>>>>>>
>>>>>> $action = 'location of the webservice';
>>>>>>
>>>>>>
>>>>>>
>>>>> The action variable is that the URL of the WSDL?
>>>>>
>>>>>
>>>>>
>>>>>> $results = $client->send($msg, $action, 60, 60);
>>>>>>
>>>>>>
>>>>>>
>>>>> Why do you have 60 twice? As far as I can see in the API the send
>>>>> document is only receiving 3 parameters?
>>>>>
>>>>> I have posted to many SOAP forums and the mailing list. No luck what
> so
>>>>> ever. Your the first to reply thanks, I think this could work.
>>>>>
>>>>> Your help is very much appreciated.
>>>>>
>>>>> regards
>>>>> Angelo
>>>>>
>>>>>
>>>> Hey Angelo,
>>>>
>>>> I know getting info for NuSOAP is a b*tch. Maybe switch to PHP5 and
> the
>>>>
>>> SOAP extension?
>>>
>>>> The $action variable is not the WSDL url. I missed that part in your
>>>>
>>> first post.
>>>
>>>> The $action var is actually build up from two parts. The first part
>>>>
>>> being the webservice
>>>
>>>> location. And the second part is /webserviceAction
>>>>
>>>> The reason i have two 60's in the method call is because in the
>>>>
>>> soapclient
>>>
>>>> class the method looks like this:
>>>>
>>>> function send($msg, $soapaction = '', $timeout=0,
> $response_timeout=30)
>>>>
>>> {
>>>
>>>> But in the meantime i've been trying some other things with NuSOAP.
> And
>>>>
>>> got this to work with WSDL.
>>>
>>>> $request = '<SubscriptionStatus xmlns='http://localhost/'>
>>>>  	<ISPID>xx</ISPID>
>>>>  	<ISPPassword>yy</ISPPassword>
>>>>  	<ISPUserID>Angelo1</ISPUserID>
>>>>  </SubscriptionStatus>';
>>>>
>>>> $params = array('request' => $request);
>>>>
>>>> $operation = 'WebserviceAction';
>>>> $result = $client->call($operation, $params, $namespace);
>>>>
>>>> Hope this helps.
>>>>
>>>>
>>>>
>>> Hi, yes I have done it as you have specified with the call method
>>> unfortunately for some weird reason that creates the duplication.
>>> However I have almost got your previous mail working. But in the XML
>>> request I have:
>>> Now I see this is present:  xmlns:0="" --> its an error thats making
> the
>>> XML invalid any reason why its making that?
>>>
>>> <?xml version="1.0" encoding="utf-8"?>
>>> <SOAP-ENV:Envelope
>>> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
>>> 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:si="http://soapinterop.org/xsd"; xmlns:0="">
>>>
>>>
>>>
>>> Another thing i that I have made the action variable to :
>>> "wsdlURL/SubscriptionStatus"  where wsdlURL is the URL of wsdl.
>>> This also doesnt work but it might have to do with the above invalid
> XML
>>> so perhaps this is the correct way to create the action parameter?
>>>
>>> Thanks again very much.
>>>
>>
>> The empy xmlns means there is no namespace set.
>> I guess you didn't provide a namespace in the serializeEnvelope method.
>> The 3rd parameter is set to false in the example. But that's where you
> should
>> set the $namspace.
>>
>> The WSDL url should work if you take of the ?wsdl part.
>>
> 
> Thanks again.
> I have specified the namespace but the problem is that its creating the
> weird characters:
> 
> xmlns:0=""
> 
> :0  Im not sure where they come from and I'm not sure I need the name
> space anyway
> 
> Any idea why its causing this character?
> thank
> 
> 

try this:
$msg = $client->serializeEnvelope($request, '', array(), 'document', 'literal');

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux