You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@ws.apache.org by GARG Shishir FTR&D <sh...@rd.francetelecom.com> on 2000/10/26 04:35:56 UTC

FW: Newbie Question: namespaces on methods

I don't know if this belongs here, but I would like to know also if this can
be done (defining your own namespace) without hacking the code.

Secondly, if it can't, then it might be something to include in v3.0 ?

I apologise if this is irrelevant.

-----Original Message-----
From: Bob Henderson [mailto:lako189@yahoo.com]
Sent: Tuesday, October 24, 2000 2:09 PM
To: soap-user@xml.apache.org
Subject: Newbie Question: namespaces on methods


Please forgive this newbie question.

I can't locate this anywhere in archives or sample
code.

Using the Call Class, how does one specify a different
namespace for a method?

Does this require a re-compile?  I would like to
specify my own namespaces for methods rather than the
ns1 that automatically comes up.

My functions are simply:

Call call = new Call();
call.setSOAPMappingRegistry(smr);
call.setTargetObjectURI("urn:myService");
call.setMethodName("myMethod");
call.setEncodingStyleURI(encodingStyleURI);

Vector params = new Vector();
params.addElement(new Parameter("myParam",
String.class,
"test", null));
call.setParams(params);

Shouldn't I be able to specify the namespace for this
method somewhere here?

I would like the namespace to also have a URI
associated with it like the ns1 does when it
automatically appears.

Please help me.

Thanks,
Bob

Re: FW: Newbie Question: namespaces on methods

Posted by Dennisf <de...@nj.paradyne.com>.
actually current code offers a good measure of flexibility
on binding various xml constructs to various namespaces.
one has a choice of picking a namespace name for a service
one deploys. Also one is not forced to use same namespace for
objects that participate in remote methods of a deployed service.
for example:
if a method package1.Object1.method1(package2.Object1, package1.Object2)

exists where package1.Object1 is a service
objects (including service) from package 1 might belong to one
namespace,
while objects from package 2 might belong to another.
As far as namespace prefixes go, they are irrelevent to the end result.
Nice prefixes perhaps would make xml docs more readable to a human,
however parsers do not care and DOM model does not "disclose" them.
Prefix was introduced so that a fully qualified element name
would not have to be enourmous.

<http://xml.acme.org/schemas/soap/cartouns/bugsBunny:rabbit>
        <http://xml.acme.org/schemas/soap/cartouns/bugsBunny:carrot>
          ...
         </http://xml.acme.org/schemas/soap/cartouns/bugsBunny:carrot>
</http://xml.acme.org/schemas/soap/cartouns/bugsBunny:rabbit>
VS
<x:rabbit xmlns:x="http://xml.acme.org/schemas/soap/cartouns/bugsBunny"
>
        <x:carrot>
            ...
        </x:carrot>
</x:rabbit>
I hope this was helpfull, for all the info on namespaces go to
http://www.w3c.org/TR/REC-xml-names

GARG Shishir FTR&D wrote:

>
>
> I don't know if this belongs here, but I would like to know also if
> this can be done (defining your own namespace) without hacking the
> code.
>
> Secondly, if it can't, then it might be something to include in v3.0 ?
>
> I apologise if this is irrelevant.
>
> -----Original Message-----
> From: Bob Henderson [mailto:lako189@yahoo.com]
> Sent: Tuesday, October 24, 2000 2:09 PM
> To: soap-user@xml.apache.org
> Subject: Newbie Question: namespaces on methods
>
> Please forgive this newbie question.
>
> I can't locate this anywhere in archives or sample
> code.
>
> Using the Call Class, how does one specify a different
> namespace for a method?
>
> Does this require a re-compile?  I would like to
> specify my own namespaces for methods rather than the
> ns1 that automatically comes up.
>
> My functions are simply:
>
> Call call = new Call();
> call.setSOAPMappingRegistry(smr);
> call.setTargetObjectURI("urn:myService");
> call.setMethodName("myMethod");
> call.setEncodingStyleURI(encodingStyleURI);
>
> Vector params = new Vector();
> params.addElement(new Parameter("myParam",
> String.class,
> "test", null));
> call.setParams(params);
>
> Shouldn't I be able to specify the namespace for this
> method somewhere here?
>
> I would like the namespace to also have a URI
> associated with it like the ns1 does when it
> automatically appears.
>
> Please help me.
>
> Thanks,
> Bob

Re: FW: Newbie Question: namespaces on methods

Posted by Dennisf <de...@nj.paradyne.com>.
actually current code offers a good measure of flexibility
on binding various xml constructs to various namespaces.
one has a choice of picking a namespace name for a service
one deploys. Also one is not forced to use same namespace for
objects that participate in remote methods of a deployed service.
for example:
if a method package1.Object1.method1(package2.Object1, package1.Object2)

exists where package1.Object1 is a service
objects (including service) from package 1 might belong to one
namespace,
while objects from package 2 might belong to another.
As far as namespace prefixes go, they are irrelevent to the end result.
Nice prefixes perhaps would make xml docs more readable to a human,
however parsers do not care and DOM model does not "disclose" them.
Prefix was introduced so that a fully qualified element name
would not have to be enourmous.

<http://xml.acme.org/schemas/soap/cartouns/bugsBunny:rabbit>
        <http://xml.acme.org/schemas/soap/cartouns/bugsBunny:carrot>
          ...
         </http://xml.acme.org/schemas/soap/cartouns/bugsBunny:carrot>
</http://xml.acme.org/schemas/soap/cartouns/bugsBunny:rabbit>
VS
<x:rabbit xmlns:x="http://xml.acme.org/schemas/soap/cartouns/bugsBunny"
>
        <x:carrot>
            ...
        </x:carrot>
</x:rabbit>
I hope this was helpfull, for all the info on namespaces go to
http://www.w3c.org/TR/REC-xml-names

GARG Shishir FTR&D wrote:

>
>
> I don't know if this belongs here, but I would like to know also if
> this can be done (defining your own namespace) without hacking the
> code.
>
> Secondly, if it can't, then it might be something to include in v3.0 ?
>
> I apologise if this is irrelevant.
>
> -----Original Message-----
> From: Bob Henderson [mailto:lako189@yahoo.com]
> Sent: Tuesday, October 24, 2000 2:09 PM
> To: soap-user@xml.apache.org
> Subject: Newbie Question: namespaces on methods
>
> Please forgive this newbie question.
>
> I can't locate this anywhere in archives or sample
> code.
>
> Using the Call Class, how does one specify a different
> namespace for a method?
>
> Does this require a re-compile?  I would like to
> specify my own namespaces for methods rather than the
> ns1 that automatically comes up.
>
> My functions are simply:
>
> Call call = new Call();
> call.setSOAPMappingRegistry(smr);
> call.setTargetObjectURI("urn:myService");
> call.setMethodName("myMethod");
> call.setEncodingStyleURI(encodingStyleURI);
>
> Vector params = new Vector();
> params.addElement(new Parameter("myParam",
> String.class,
> "test", null));
> call.setParams(params);
>
> Shouldn't I be able to specify the namespace for this
> method somewhere here?
>
> I would like the namespace to also have a URI
> associated with it like the ns1 does when it
> automatically appears.
>
> Please help me.
>
> Thanks,
> Bob