You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-dev@ws.apache.org by José Antonio Sánchez <ge...@gmail.com> on 2006/12/15 15:31:15 UTC

Addressing issue.

Hello, I'm trying to send a complex type with an operation. That
complex type has a EndpointReference element included in the following
form:

<element name="HostLocation" type="wsa:EndpointReferenceType"/>

I try to generate a serializer using xmlbeans but when I print the xml
code of a HostLocationDocument I get this:

<HostLocation xmlns="http://lsd.org/wsdm/HostInstallationSchema">
  <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsa:Address>http://localhost</wsa:Address>
  </wsa:EndpointReference>
</HostLocation>

Also, for example, WS-Notification types has EndpointReferenceType
elements, for example, the ProducerReference element defined as:

<xsd:element name="ProducerReference"  type="wsa:EndpointReferenceType" />

but in a notification, I see the following XML code:

<wsnt:ProducerReference>
                    <wsa:ReferenceParameters
xmlns:wsa="http://www.w3.org/2005/08/addressing"/>
                    <wsa:Address
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://127.0.0.1:8081/NotificationService/services/Notification</wsa:Address>
</wsnt:ProducerReference>

So which one is the right choice? Is it a bug in the xmbeans
generation process? Shouldn't it be like that?

<HostLocation xmlns="http://lsd.org/wsdm/HostInstallationSchema" >
   <wsa:Address
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://localhost</wsa:Address>
</HostLocation>


-- 
Saludos.
José Antonio Sánchez

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


Re: Addressing issue.

Posted by José Antonio Sánchez <ge...@gmail.com>.
The problem here is that this EndpointReference element is part of a
greater complex type, so I gess I have to write my serializer without
the xmlbeans help.

On 12/15/06, Daniel Jemiolo <da...@us.ibm.com> wrote:
> You are correct - it should look like the last fragment in your email.
> Going with your other example, if you look at the WSN spec, you will see
> sample SOAP fragments that confirm you (and Muse's XML fragment) are
> correct. Looks like an XmlBeans issue.
>
> Incidentally, if you want to send EPRs as parameters from the client side,
> you can write code like this:
>
>
> import org.apache.muse.ws.addressing.EndpointReference;
>
> ...
>
> public void myOperation(EndpointReference epr)
> {
>         Object[] params = new Object[1];
>         params[0] = epr;
>
>         ProxyHandler handler = getHandler("myOperation");
>         invoke(handler, params);
> }
>
>
> The code that wsdl2java generates should already look like this, except it
> will have "Element" instead of "EndpointReference". Just change Element to
> EndpointReference and you should be all set. The code works because our
> EndpointReference class implements
> org.apache.muse.util.xml.XmlSerializable, so the client code knows what
> method to call to convert it to XML.
>
> Dan
>
>
>
> "José Antonio Sánchez" <ge...@gmail.com> wrote on 12/15/2006 09:31:15
> AM:
>
> > Hello, I'm trying to send a complex type with an operation. That
> > complex type has a EndpointReference element included in the following
> > form:
> >
> > <element name="HostLocation" type="wsa:EndpointReferenceType"/>
> >
> > I try to generate a serializer using xmlbeans but when I print the xml
> > code of a HostLocationDocument I get this:
> >
> > <HostLocation xmlns="http://lsd.org/wsdm/HostInstallationSchema">
> >   <wsa:EndpointReference
> xmlns:wsa="http://www.w3.org/2005/08/addressing">
> >     <wsa:Address>http://localhost</wsa:Address>
> >   </wsa:EndpointReference>
> > </HostLocation>
> >
> > Also, for example, WS-Notification types has EndpointReferenceType
> > elements, for example, the ProducerReference element defined as:
> >
> > <xsd:element name="ProducerReference"  type="wsa:EndpointReferenceType"
> />
> >
> > but in a notification, I see the following XML code:
> >
> > <wsnt:ProducerReference>
> >                     <wsa:ReferenceParameters
> > xmlns:wsa="http://www.w3.org/2005/08/addressing"/>
> >                     <wsa:Address
> > xmlns:wsa="http://www.w3.org/2005/08/addressing">http://127.0.0.1:
> > 8081/NotificationService/services/Notification</wsa:Address>
> > </wsnt:ProducerReference>
> >
> > So which one is the right choice? Is it a bug in the xmbeans
> > generation process? Shouldn't it be like that?
> >
> > <HostLocation xmlns="http://lsd.org/wsdm/HostInstallationSchema" >
> >    <wsa:Address
> >
> xmlns:wsa="http://www.w3.org/2005/08/addressing">http://localhost</wsa:Address>
> > </HostLocation>
> >
> >
> > --
> > Saludos.
> > José Antonio Sánchez
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: muse-dev-help@ws.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>
>


-- 
Saludos.
José Antonio Sánchez

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


Re: Addressing issue.

Posted by Daniel Jemiolo <da...@us.ibm.com>.
You are correct - it should look like the last fragment in your email. 
Going with your other example, if you look at the WSN spec, you will see 
sample SOAP fragments that confirm you (and Muse's XML fragment) are 
correct. Looks like an XmlBeans issue.

Incidentally, if you want to send EPRs as parameters from the client side, 
you can write code like this:


import org.apache.muse.ws.addressing.EndpointReference;

...

public void myOperation(EndpointReference epr)
{
        Object[] params = new Object[1];
        params[0] = epr;

        ProxyHandler handler = getHandler("myOperation");
        invoke(handler, params);
}


The code that wsdl2java generates should already look like this, except it 
will have "Element" instead of "EndpointReference". Just change Element to 
EndpointReference and you should be all set. The code works because our 
EndpointReference class implements 
org.apache.muse.util.xml.XmlSerializable, so the client code knows what 
method to call to convert it to XML.

Dan



"José Antonio Sánchez" <ge...@gmail.com> wrote on 12/15/2006 09:31:15 
AM:

> Hello, I'm trying to send a complex type with an operation. That
> complex type has a EndpointReference element included in the following
> form:
> 
> <element name="HostLocation" type="wsa:EndpointReferenceType"/>
> 
> I try to generate a serializer using xmlbeans but when I print the xml
> code of a HostLocationDocument I get this:
> 
> <HostLocation xmlns="http://lsd.org/wsdm/HostInstallationSchema">
>   <wsa:EndpointReference 
xmlns:wsa="http://www.w3.org/2005/08/addressing">
>     <wsa:Address>http://localhost</wsa:Address>
>   </wsa:EndpointReference>
> </HostLocation>
> 
> Also, for example, WS-Notification types has EndpointReferenceType
> elements, for example, the ProducerReference element defined as:
> 
> <xsd:element name="ProducerReference"  type="wsa:EndpointReferenceType" 
/>
> 
> but in a notification, I see the following XML code:
> 
> <wsnt:ProducerReference>
>                     <wsa:ReferenceParameters
> xmlns:wsa="http://www.w3.org/2005/08/addressing"/>
>                     <wsa:Address
> xmlns:wsa="http://www.w3.org/2005/08/addressing">http://127.0.0.1:
> 8081/NotificationService/services/Notification</wsa:Address>
> </wsnt:ProducerReference>
> 
> So which one is the right choice? Is it a bug in the xmbeans
> generation process? Shouldn't it be like that?
> 
> <HostLocation xmlns="http://lsd.org/wsdm/HostInstallationSchema" >
>    <wsa:Address
> 
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://localhost</wsa:Address>
> </HostLocation>
> 
> 
> -- 
> Saludos.
> José Antonio Sánchez
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-dev-help@ws.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org