You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by haipeng du <ha...@gmail.com> on 2010/10/06 00:31:55 UTC
Is this one still live? I ask this several times. how could I put all
schema to the same namespace
> I create webserice with axis2 and generate wsdl from url
> http://myserver/services/myservice?wsdl. But for pojo objects in different
> package, it generates different schema namespace. I know from java2wsdl
> command, I can map all package to same namespace. How could I do from
> service.xml? I give element <schema namespace="mynamespace" /> in
> service.xml. But it just put my service class to that namespace and not for
> my pojo models.
> Thanks a lot.
>
--
Haipeng Du
Salt Lake City
Re: Is this one still live? I ask this several times. how could I put
all schema to the same namespace
Posted by Nan Null <nu...@gmail.com>.
I have done that, and I didn't have problem with name space from the
service. Basically, here's what I did:
1) Created Java classes/interfaces all in a same package
2) Generates WSDL with namespace mapping options. There are several
mappings there, not just one.
You can check the WSDL to make sure the correct namespaces are created.
3) From the generated WSDL, you can create the service out of that.
The name spaces should be preserved when you look at the service's
WSDL file (almost identical if not identical to the one you
generated).
4) You can generate Java client code using the WSDL, make sure to map
the namespaces back to the packages you want for your client. Look at
the source, maybe you didn't pass in the expected format for the
namespace mappings.
Use Ant to do the job for you.
If it's an urgent, probably you can nicely ask again. However, it
still can be offensive to some people because it's a free service
here. You can always pay someone for faster answer.
On Wed, Oct 6, 2010 at 11:24 AM, haipeng du <ha...@gmail.com> wrote:
> If you think that is rude, I gave my appology for this. Because I need to
> fix this problem as soon as possible. And I search internet for several days
> and can not get any answer for this.
> I read that article several times . It just works for service class. Inside
> service, I use some pojos which are in different package. It generated
> schema in different namespace. From java2wsdl command, there is one option
> called p2n which means give mapping for package to namespace. I can generate
> wsdl that we want. But when I get response from service, it still has
> different namespace for different packages. I think I have to modify service
> to apply the same settings for axis service. I check the source code, and
> there is one property called get/setP2nMap, I bet that should be the same
> like p2n option in java2wsdl command. But I have no any idea to use that. I
> did not find any documentation to talk about it.
> Thanks a lot.
>
> On Tue, Oct 5, 2010 at 5:42 PM, Charles Galpin <cg...@lhsw.com> wrote:
>>
>> Hi Haipeng
>> We are all busy and no-one has any obligation to respond, so posting
>> several times in a row isn't productive (and often considered rude).
>> I am changing the namespace reported by using a schema tag in my service
>> definition (services.xml), specifically using the schemaNamespace and
>> targetNamespace attributes of the schema tag.
>> See http://wso2.org/library/2060 for more info
>> I believe you can do it with jsr 181 annotations in the code too, but
>> don't recall details off the top of my head. Something like
>> @WebService(name="MyService" targteNamespace="http://mynamespace" )
>> public class MyPojo {
>> …
>> }
>> hth
>> charles
>> On Oct 5, 2010, at 6:31 PM, haipeng du wrote:
>>
>>> I create webserice with axis2 and generate wsdl from url
>>> http://myserver/services/myservice?wsdl. But for pojo objects in different
>>> package, it generates different schema namespace. I know from java2wsdl
>>> command, I can map all package to same namespace. How could I do from
>>> service.xml? I give element <schema namespace="mynamespace" /> in
>>> service.xml. But it just put my service class to that namespace and not for
>>> my pojo models.
>>> Thanks a lot.
>>
>>
>> --
>> Haipeng Du
>> Salt Lake City
>>
>
>
>
> --
> Haipeng Du
> Salt Lake City
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org
RE: Is this one still live? I ask this several times. how could I
put all schema to the same namespace
Posted by Martin Gainty <mg...@hotmail.com>.
p2n [<java package>,<namespace] [<java package>,<namespace]... ")
so you will need to know (apriori) each java-package and the namespace you will be implementing
to reiterate what charles said eariler it is difficult to provide specific instructions without knowing which version of axis you are implementing
Viel Gluck,
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Date: Wed, 6 Oct 2010 09:24:35 -0600
Subject: Re: Is this one still live? I ask this several times. how could I put all schema to the same namespace
From: haipengdu@gmail.com
To: java-user@axis.apache.org
If you think that is rude, I gave my appology for this. Because I need to fix this problem as soon as possible. And I search internet for several days and can not get any answer for this.
I read that article several times . It just works for service class. Inside service, I use some pojos which are in different package. It generated schema in different namespace. From java2wsdl command, there is one option called p2n which means give mapping for package to namespace. I can generate wsdl that we want. But when I get response from service, it still has different namespace for different packages. I think I have to modify service to apply the same settings for axis service. I check the source code, and there is one property called get/setP2nMap, I bet that should be the same like p2n option in java2wsdl command. But I have no any idea to use that. I did not find any documentation to talk about it.
Thanks a lot.
On Tue, Oct 5, 2010 at 5:42 PM, Charles Galpin <cg...@lhsw.com> wrote:
Hi Haipeng
We are all busy and no-one has any obligation to respond, so posting several times in a row isn't productive (and often considered rude).
I am changing the namespace reported by using a schema tag in my service definition (services.xml), specifically using the schemaNamespace and targetNamespace attributes of the schema tag.
See http://wso2.org/library/2060 for more info
I believe you can do it with jsr 181 annotations in the code too, but don't recall details off the top of my head. Something like
@WebService(name="MyService" targteNamespace="http://mynamespace" )
public class MyPojo {
…
}
hth
charles
On Oct 5, 2010, at 6:31 PM, haipeng du wrote:
I create webserice with axis2 and generate wsdl from url http://myserver/services/myservice?wsdl. But for pojo objects in different package, it generates different schema namespace. I know from java2wsdl command, I can map all package to same namespace. How could I do from service.xml? I give element <schema namespace="mynamespace" /> in service.xml. But it just put my service class to that namespace and not for my pojo models.
Thanks a lot.
--
Haipeng Du
Salt Lake City
--
Haipeng Du
Salt Lake City
Re: Is this one still live? I ask this several times. how could I put
all schema to the same namespace
Posted by haipeng du <ha...@gmail.com>.
If you think that is rude, I gave my appology for this. Because I need to
fix this problem as soon as possible. And I search internet for several days
and can not get any answer for this.
I read that article several times . It just works for service class. Inside
service, I use some pojos which are in different package. It generated
schema in different namespace. From java2wsdl command, there is one option
called p2n which means give mapping for package to namespace. I can generate
wsdl that we want. But when I get response from service, it still has
different namespace for different packages. I think I have to modify service
to apply the same settings for axis service. I check the source code, and
there is one property called get/setP2nMap, I bet that should be the same
like p2n option in java2wsdl command. But I have no any idea to use that. I
did not find any documentation to talk about it.
Thanks a lot.
On Tue, Oct 5, 2010 at 5:42 PM, Charles Galpin <cg...@lhsw.com> wrote:
> Hi Haipeng
>
> We are all busy and no-one has any obligation to respond, so posting
> several times in a row isn't productive (and often considered rude).
>
> I am changing the namespace reported by using a schema tag in my service
> definition (services.xml), specifically using the schemaNamespace and
> targetNamespace attributes of the schema tag.
>
> See http://wso2.org/library/2060 for more info
>
> I believe you can do it with jsr 181 annotations in the code too, but don't
> recall details off the top of my head. Something like
>
> @WebService(name="MyService" targteNamespace="http://mynamespace" )
> public class MyPojo {
> …
> }
>
> hth
> charles
>
> On Oct 5, 2010, at 6:31 PM, haipeng du wrote:
>
>
> I create webserice with axis2 and generate wsdl from url
>> http://myserver/services/myservice?wsdl. But for pojo objects in
>> different package, it generates different schema namespace. I know from
>> java2wsdl command, I can map all package to same namespace. How could I do
>> from service.xml? I give element <schema namespace="mynamespace" /> in
>> service.xml. But it just put my service class to that namespace and not for
>> my pojo models.
>> Thanks a lot.
>>
>
> --
> Haipeng Du
> Salt Lake City
>
>
>
--
Haipeng Du
Salt Lake City
Re: Is this one still live? I ask this several times. how could I put all schema to the same namespace
Posted by Charles Galpin <cg...@lhsw.com>.
Hi Haipeng
We are all busy and no-one has any obligation to respond, so posting several times in a row isn't productive (and often considered rude).
I am changing the namespace reported by using a schema tag in my service definition (services.xml), specifically using the schemaNamespace and targetNamespace attributes of the schema tag.
See http://wso2.org/library/2060 for more info
I believe you can do it with jsr 181 annotations in the code too, but don't recall details off the top of my head. Something like
@WebService(name="MyService" targteNamespace="http://mynamespace" )
public class MyPojo {
…
}
hth
charles
On Oct 5, 2010, at 6:31 PM, haipeng du wrote:
>
> I create webserice with axis2 and generate wsdl from url http://myserver/services/myservice?wsdl. But for pojo objects in different package, it generates different schema namespace. I know from java2wsdl command, I can map all package to same namespace. How could I do from service.xml? I give element <schema namespace="mynamespace" /> in service.xml. But it just put my service class to that namespace and not for my pojo models.
> Thanks a lot.
>
> --
> Haipeng Du
> Salt Lake City