SOAP::Lite "<namesp1:...." prefix
SOAP::Lite "<namesp1:...." prefix
am 01.12.2006 11:13:52 von Forsh
Hi All,
I'm quite new to Perl and SOAP and have a problem whereby I cant change
the "namesp1" prefix of one of the tags in the serialised SOAP::Lite
message. The message is analogous to :
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding /"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
aaaaaaaa
bbbbbbbb
cccccccc
dddddddd
Does anyone know how to change/remove the "namesp1:" prefix to make the
tag look like:
aaaaaaaa
Regards
Forsh
Re: SOAP::Lite "<namesp1:...." prefix
am 01.12.2006 14:33:32 von Forsh
I think I could have worded this slightly better -
"How do I change/remove the method element prefix?" would be more
appropriate :)
Re: SOAP::Lite "<namesp1:...." prefix
am 01.12.2006 17:21:47 von Morten Guldager
2006-12-01 Forsh wrote
>
> I think I could have worded this slightly better -
>
> "How do I change/remove the method element prefix?" would be more
> appropriate :)
At the server or client side? (not sure if it matters)
Is the "element" you want to change the same as the namespace?
/Morten %-) - new to soap as well....
Re: SOAP::Lite "<namesp1:...." prefix
am 01.12.2006 17:43:11 von Forsh
Morten Guldager wrote:
> 2006-12-01 Forsh wrote
> >
> > I think I could have worded this slightly better -
> >
> > "How do I change/remove the method element prefix?" would be more
> > appropriate :)
>
> At the server or client side? (not sure if it matters)
>
It is at the client side. (It does matter in this instance!)
> Is the "element" you want to change the same as the namespace?
>
>
> /Morten %-) - new to soap as well....
The element that I want to change is this wrapper:
The "namesp1" text is the "method element prefix", and if possible I
need to get this wrapper to look like:
I have found it very difficult to find useful information on this
subject, other than lots of references to some interoperability
problems between Perl SOAP::Lite and dotNet web services.
Re: SOAP::Lite "<namesp1:...." prefix
am 02.12.2006 00:21:29 von paduille.4060.mumia.w
On 12/01/2006 10:43 AM, Forsh wrote:
> Morten Guldager wrote:
>
>> 2006-12-01 Forsh wrote
>>> I think I could have worded this slightly better -
>>>
>>> "How do I change/remove the method element prefix?" would be more
>>> appropriate :)
>> At the server or client side? (not sure if it matters)
>>
>
>
> It is at the client side. (It does matter in this instance!)
>
>> Is the "element" you want to change the same as the namespace?
>>
>>
>> /Morten %-) - new to soap as well....
>
> The element that I want to change is this wrapper:
>
>
>
>
> The "namesp1" text is the "method element prefix", and if possible I
> need to get this wrapper to look like:
>
>
>
>
> I have found it very difficult to find useful information on this
> subject, other than lots of references to some interoperability
> problems between Perl SOAP::Lite and dotNet web services.
>
Ideally you would have the XML parser or generator remove the XML
namespace qualifiers; however, a particularly dangerous way to do it is
this:
$data =~ s/:?\bnamesp1\b:?//g;
Manipulating XML using regular expressions this way is dangerous. Try to
find a module that supports removing namespace information from XML.
--
paduille.4060.mumia.w@earthlink.net
Re: SOAP::Lite "<namesp1:...." prefix
am 02.12.2006 19:48:16 von unknown
Forsh wrote:
> Morten Guldager wrote:
>
>
>>2006-12-01 Forsh wrote
>>
>>>I think I could have worded this slightly better -
>>>
>>>"How do I change/remove the method element prefix?" would be more
>>>appropriate :)
>>
>>At the server or client side? (not sure if it matters)
>>
>
>
>
> It is at the client side. (It does matter in this instance!)
>
>
>>Is the "element" you want to change the same as the namespace?
>>
>>
>>/Morten %-) - new to soap as well....
>
>
> The element that I want to change is this wrapper:
>
>
>
>
> The "namesp1" text is the "method element prefix", and if possible I
> need to get this wrapper to look like:
>
>
>
>
> I have found it very difficult to find useful information on this
> subject, other than lots of references to some interoperability
> problems between Perl SOAP::Lite and dotNet web services.
>
I haven't seen any code exhibited, but if I understand the question
(which is to get rid of the bogus namespace specification on the front
of the method name) something like
$soap->call (SOAP::Data
->name ('NameOfWebserviceMethod')
->attr ({xmlns => 'MyWebService'}),
@argument_list_here);
might be a step in the right direction, assuming $soap is the SOAP
object you're working from.
If your service is more persnickety than Perl is about arguments, your
arguments might also need to be SOAP::Data objects: something like
SOAP::Data->new (
name => 'Arg_name_1',
type => 'whatever_this_is',
value => $whatever_this_is_too,
);
might do the trick.
If you have WSDL to work from, see stubmaker.pl, which comes with
SOAP::Lite, and gets installed somewhere on your path.
Tom Wyant
Re: SOAP::Lite "<namesp1:...." prefix
am 04.12.2006 13:01:10 von Forsh
Thanks very much for the information - it was most helpful. I have
used stubmaker.pl to make a stub from the wsdl, which I can amend to
tweak the resulting soap request.
I have one more issue to resolve; it is really frustrating.. it seems
that if I specify the "uri" within the .pm file that stubmaker made, as
"WebService", the resulting method element tag looks like the example
below, i.e. with the "namesp1" prefix.
If I do not specify the "uri" then the tag looks like:
i.e. it does not have the "namesp1" prefixes, but the actual "xmlns"
value is blank too. It's either one or the other, both are wrong for
my purposes as dotNet rejects them. I would love to be able to get the
tag to look like:
I've been going around in circles for days now and, short of editting
the core SOAP files within Perl, I cannot see a way around this,
although I am sure there must be one.
Regards
Re: SOAP::Lite "<namesp1:...." prefix
am 04.12.2006 17:25:10 von Forsh
Ignore that last message! It was a bit of a false alarm, I've managed
to get it to work now and it wasnt really as much of dotNet's fault as
I first made out. I had assumed I needed to get the SOAP request into
a character-perfect representation of what dotNet wanted but it was not
the case.. it isnt as strict as I thought.
Thanks to those people who helped - it's much appreciated.
Forsh