Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

SOAP reply with correct namespace

by dcunningham (Initiate)
on Sep 03, 2012 at 04:11 UTC ( #991350=perlquestion: print w/ replies, xml ) Need Help??
dcunningham has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

We have a SOAP server created with "SOAP::Transport::HTTP::Server->new();", however for some reason it doesn't reply with the same namespace as the SOAP request.

For example if we get request:
<q1:get_my_person xmlns:q1="http://127.0.0.1/Our/API">...</q1:get_my_person>

Then I think we should reply with:
<q1:get_my_personResponse xmlns:q1="http://127.0.0.1/Our/API">...</q1:get_my_personResponse>

But we actually reply:
<get_my_personResponse xmlns="http://127.0.0.1/Our/API">...</get_my_personResponse>

Am I right in what I think? Anyone know how to make SOAP::Transport::HTTP::Server reply with the namespace provided by the client?
BTW, the namespace seems to be an issue because Visual Studio client won't recognise the result without the namespace it provided. Any advice on Visual Studio specific issues also welcome.
Thanks!

Comment on SOAP reply with correct namespace
Select or Download Code
Re: SOAP reply with correct namespace
by Anonymous Monk on Sep 03, 2012 at 06:34 UTC

    Am I right in what I think?

    I think no.

    Anyone know how to make SOAP::Transport::HTTP::Server reply with the namespace provided by the client?

    Specify a namespace, use one the client gives you, basic SOAP::Data.... make some xml

    BTW, the namespace seems to be an issue because Visual Studio client won't recognise the result without the namespace it provided.

    That sounds backwards, but it probably isn't the case. The likely issue is your WSDL specification is wrong, in addition to SOAP::Lite not handling it correctly.

    PS. I hate soap.

Re: SOAP reply with correct namespace
by dcunningham (Initiate) on Sep 05, 2012 at 07:57 UTC
    Ok, to be more specific, anyone know how to get the namespace passed from the client using SOAP::Transport::HTTP::Server?

    And what is the best way to set the namespace on the reply? I know about the $server->serializer( MySerializer->new ); method, but it seems a bit long winded.

    Not a fan of SOAP either, but having to make do! Thanks.

      Ok, to be more specific, anyone know how to get the namespace passed from the client using SOAP::Transport::HTTP::Server?

      Interrogate the appropriate object, like the envelope, there is an example in this treasure trove of SOAP examples and SOAP::Server/SOAP::SOM

      And what is the best way to set the namespace on the reply? I know about the $server->serializer( MySerializer->new ); method, but it seems a bit long winded.

      I don't know of a different way to do it, do you?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://991350]
Approved by kcott
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2014-07-30 09:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (230 votes), past polls