Thread

Posted on Wed Jun 6 07:45:59 2007 by glauron
filling out xmlns in method element while using WSDL
Hi - having great problems solving something - hoping someone here can give me a pointer! I'm building an app which calls a web service on a remote server, and they have supplied a WSDL file. Works fine, except for one minor but fundamental issue. I need to generate the following:
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:SOAP-ENC="http://sch +emas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns: +xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/enc +oding/"> <SOAP-ENV:Body> <Method xmlns="Name Space"> <Account xsi:type="xsd:string">111111</Account> <Username xsi:type="xsd:string">usr.name</OperatorUsername> <Password xsi:type="xsd:string">paSSwoRd</Password> </Method> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
I can do all that no problems, except for this line:
<Method xmlns="Name Space">
In all my attempts, I can only get:
<Method>
I found the way to do it by scouring docs...
my $method = SOAP::Data->name('Method')->attr( {xmlns => 'Name Space'} ); $response = $service->call( $method, SOAP::Data->type('string')->name( Account => '111111' ), ... );
If I use the
$service->serializer->envelope( method => $method, ...)
it shows me I have it right... But if I send it away using the $service->call( $method, params... ) I get:
Transport is not specified (using proxy() method or service description)
But if I simply called the method:
$response = $service->Method( params... );
I don't get any complaints, except I can't define the name space that way & the remote server rejects it. I can only assume it has something to do with the WSDL file, and by using $sevice->call(...) it looks for the proxy setting or something instead of whatever was defined in the WSDL? I'm at a loss, but need the solved relatively soon. I've tried everything I can think of & put my hope in you good people. in summary, is there a way I can define the namespace of a method call, while invoking it in such a manner:
$service->Method( params ... )
or alternatively, can I still have SOAP::Lite recognize the WSDL settings when I use:
$service->call( $method, params ... )
or maybe even! - is there a simple way to submit an envelope that has already been generated? Thank you all very much for ideas & suggestions.
Direct Responses: 5329 | Write a response
Posted on Wed Jun 6 10:11:16 2007 by glauron in response to 5328
Re: filling out xmlns in method element while using WSDL
Was pretty simple after all that... add a "proxy( $server )" when creating the service is all it needed. It was giving errors which were actually responses from the server. :| Thx anyway.
my $method = SOAP::Data->name('Method')->attr( {xmlns => 'Name Space'} ); my $service = SOAP::Lite->service( $service )->proxy( $server ); $response = $service->call( $method, SOAP::Data->type('string')->name( Account => '111111' ), ... ) +;
Write a response