You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Johannes Elsinghorst <Jo...@gmx.net> on 2008/04/15 08:36:25 UTC

namespaces in soap message

Hi,
i have a ws that supports different clientversions. It does this by 
accepting  different namespaces in the soapmessage like this:

<envelope xmlns ns0="http://ws/version1">
...
</Envelope>


<envelope xmlns ns0="http://ws/version2">
...
</Envelope>


<envelope xmlns ns0="http://ws/version3">
...
</Envelope>

I have this WS in lets say version3 and use its wsdl to publish it on 
the bus via cxf.
For interoperability across versions the client tries to invoke 
operations on the ws using the version1-ns.
This works fine on the original service, but the cxf-bc-service faults 
with an "operation not bound"-exception,
since in its wsdl the version3-ns is used.
Is there any solution to this?

Thanks, Johannes

Re: namespaces in soap message

Posted by Johannes Elsinghorst <Jo...@gmx.net>.
What i did:
i have an http-service-unit that look like this:
 <http:endpoint service="ns0:Catalog"
                 endpoint="ns0:ServiceCatalogPort"
                 role="provider"
                 locationURI="http://windows2003/services/"
                  />
   <http:endpoint service="meins:Catalog"                 
                  endpoint="meins:ServiceCatalogPort"
                  role="consumer"
                  locationURI="http://johannes:8181/services/"
                  />
now i want camel to route from the provider to the consumer:
 from("jbi:endpoint:ns0/Catalog/ServiceCatalogPort")
.to("jbi:endpoint:meins/Catalog/ServiceCatalogPort");
It doesnt do anything :-(


>    from("http://localhost:8080/MyService").
>       choice().
>          when( xxx ).to("direct:xxx1").
>          when( xxx ).to("direct:xxx2").
>          otherwise().to("direct:xxx3");
>   from("soap:direct:xxx1").xxx
>   from("soap:direct:xxx2").xxx
>   from("soap:direct:xxx3").xxx
>   
Can you explain that? The "from("http://localhost:8080/MyService")" will 
open an endpoint? or do i have to configure one as i did above? Whats 
direct all about?

thanks, Johannes

Re: namespaces in soap message

Posted by Guillaume Nodet <gn...@gmail.com>.
This is about endpoint versioning really and I think this use case makes
sense.  However it is not supported.
I think you can achieve what you want by using an HTTP endpoint (not soap
aware), perform some routing based on the namespace version, and then direct
to one of three different soap-enabled endpoints.  The biggest problem is
that we don't have any soap-enabled endpoint that does not use a "real"
transport.
I would consider using camel and do something along the following:

   from("http://localhost:8080/MyService").
      choice().
         when( xxx ).to("direct:xxx1").
         when( xxx ).to("direct:xxx2").
         otherwise().to("direct:xxx3");
  from("soap:direct:xxx1").xxx
  from("soap:direct:xxx2").xxx
  from("soap:direct:xxx3").xxx

It should work, because the soap camel component can be used on top of any
other camel transport (here, we use the direct transport).

On Tue, Apr 15, 2008 at 9:05 AM, Freeman Fang <fr...@gmail.com>
wrote:

> Hi Johannes,
>
> I'm not sure I understand what you want.
> Do you mean you want publish wsdl with ns version3, and you use client
> with ns version1, and you hope ns version1 client can talk with ns version3
> server?
> If so, I'm fear you can't do that.
> I don't know what's your wsdl looks like, so I can't tell your soap
> message type, such as rpc/literal or doc/literal/wrapped. For rpc/literal,
> since the message part is not qualified, which means only localName is used,
> so it may work across different ns version. But it's definitely not working
> for doc/literal which element is qualified so we need the match namespace to
> find operation from servicemodel.
>
> You mentioned "This works fine on the original service, but the
> cxf-bc-service faults with an "operation not bound"-exception", I can't
> understand it, what's the origianl service, it's also by cxf?
>
> Regards
> Freeman
>
>
> Johannes Elsinghorst wrote:
>
> > Hi,
> > i have a ws that supports different clientversions. It does this by
> > accepting  different namespaces in the soapmessage like this:
> >
> > <envelope xmlns ns0="http://ws/version1">
> > ...
> > </Envelope>
> >
> >
> > <envelope xmlns ns0="http://ws/version2">
> > ...
> > </Envelope>
> >
> >
> > <envelope xmlns ns0="http://ws/version3">
> > ...
> > </Envelope>
> >
> > I have this WS in lets say version3 and use its wsdl to publish it on
> > the bus via cxf.
> > For interoperability across versions the client tries to invoke
> > operations on the ws using the version1-ns.
> > This works fine on the original service, but the cxf-bc-service faults
> > with an "operation not bound"-exception,
> > since in its wsdl the version3-ns is used.
> > Is there any solution to this?
> >
> > Thanks, Johannes
> >
> >
>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/

Re: namespaces in soap message

Posted by Johannes Elsinghorst <Jo...@gmx.net>.
Hi,
its doc/literal, so i'll give camel a try. The 'original' service is not 
cxf its a tomcat (Server: Apache-Coyote/1.1)servlet i think, or a .net 
(Server: Microsoft-IIS/6.0
Asp.Net 2.0) http-handler.
> Hi Johannes,
>
> I'm not sure I understand what you want.
> Do you mean you want publish wsdl with ns version3, and you use client 
> with ns version1, and you hope ns version1 client can talk with ns 
> version3 server?
> If so, I'm fear you can't do that.
> I don't know what's your wsdl looks like, so I can't tell your soap 
> message type, such as rpc/literal or doc/literal/wrapped. For 
> rpc/literal, since the message part is not qualified, which means only 
> localName is used, so it may work across different ns version. But 
> it's definitely not working for doc/literal which element is qualified 
> so we need the match namespace to find operation from servicemodel.
>
> You mentioned "This works fine on the original service, but the 
> cxf-bc-service faults with an "operation not bound"-exception", I 
> can't understand it, what's the origianl service, it's also by cxf?
>
> Regards
> Freeman
>
> Johannes Elsinghorst wrote:
>> Hi,
>> i have a ws that supports different clientversions. It does this by 
>> accepting  different namespaces in the soapmessage like this:
>>
>> <envelope xmlns ns0="http://ws/version1">
>> ...
>> </Envelope>
>>
>>
>> <envelope xmlns ns0="http://ws/version2">
>> ...
>> </Envelope>
>>
>>
>> <envelope xmlns ns0="http://ws/version3">
>> ...
>> </Envelope>
>>
>> I have this WS in lets say version3 and use its wsdl to publish it on 
>> the bus via cxf.
>> For interoperability across versions the client tries to invoke 
>> operations on the ws using the version1-ns.
>> This works fine on the original service, but the cxf-bc-service 
>> faults with an "operation not bound"-exception,
>> since in its wsdl the version3-ns is used.
>> Is there any solution to this?
>>
>> Thanks, Johannes
>>
>


Re: namespaces in soap message

Posted by Freeman Fang <fr...@gmail.com>.
Hi Johannes,

I'm not sure I understand what you want.
Do you mean you want publish wsdl with ns version3, and you use client 
with ns version1, and you hope ns version1 client can talk with ns 
version3 server?
If so, I'm fear you can't do that.
I don't know what's your wsdl looks like, so I can't tell your soap 
message type, such as rpc/literal or doc/literal/wrapped. For 
rpc/literal, since the message part is not qualified, which means only 
localName is used, so it may work across different ns version. But it's 
definitely not working for doc/literal which element is qualified so we 
need the match namespace to find operation from servicemodel.

You mentioned "This works fine on the original service, but the 
cxf-bc-service faults with an "operation not bound"-exception", I can't 
understand it, what's the origianl service, it's also by cxf?

Regards
Freeman

Johannes Elsinghorst wrote:
> Hi,
> i have a ws that supports different clientversions. It does this by 
> accepting  different namespaces in the soapmessage like this:
>
> <envelope xmlns ns0="http://ws/version1">
> ...
> </Envelope>
>
>
> <envelope xmlns ns0="http://ws/version2">
> ...
> </Envelope>
>
>
> <envelope xmlns ns0="http://ws/version3">
> ...
> </Envelope>
>
> I have this WS in lets say version3 and use its wsdl to publish it on 
> the bus via cxf.
> For interoperability across versions the client tries to invoke 
> operations on the ws using the version1-ns.
> This works fine on the original service, but the cxf-bc-service faults 
> with an "operation not bound"-exception,
> since in its wsdl the version3-ns is used.
> Is there any solution to this?
>
> Thanks, Johannes
>