Hi ,
It looks like you don't want the implicit headers pass into the paramArray.
I am not sure what you want to deal with the soap header.
If you do not want the header info pass to the invoker, you can add a
customer interceptor into you endpoint to remove the list parameter
content which is set by SoapHeaderInterceptor.
BTW,
If you want to solve the problem quickly and effectively , my suggestion
is you send the mail to the mail-list.
There are lots of warm hearted people will give you their hands and they
can also learn from your question.
Willem.
Morten Andersen wrote:
Hi
Thanks for you quick response.
I have followed your guide and for now that part seems to work :o)
The next problem I ran into was about the method invocation and I'm not
sure it is relative to the thread.
I'm using implicit headers and I can see that when
org.apache.cxf.service.invoker.AbstractInvoker
performInvocation(exchange, serviceObject, m, paramArray) is called, it
expect that the implicit header is given to the method.
I have used org.apache.cxf.tools.wsdlto.WSDLToJava to generate my
classes with argument "-fe jaxws".
The wsdl looks like this:
<message name="oneRequest">
<part name="body" element="tls:..."/>
</message>
<message name="oneRequestHeader">
<part name="header" element="header:..."/>
</message>
<message name="oneResponse">
<part name="body" element="tls:..."/>
</message>
<portType name="OnePort">
<operation name="saySomething">
<input message="tns:oneRequest" />
<output message="tns:oneResponse"/>
</operation>
</portType>
<binding name="OnePortBinding" type="tns:OnePort">
<soap:binding transport="http://www.openuri.org/2002/04/soap/jms/"
style="document"/>
<operation name="saySomething">
<input>
<soap:body parts="body" use="literal"/>
<soap:header message="tns:oneHeader" part="header" use="literal"
/>
</input>
<output>
<soap:body parts="body" use="literal"/>
</output>
</operation>
</binding>
And the Port class I got out of that look like this:
@WebService(name = "OnePort",
targetNamespace = "...")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public interface OnePort {
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@WebMethod(operationName = "saySomething")
@WebResult(partName = "body", name = "OneResponse", targetNamespace
= "...")
public ....OneResponse saySomething(
@WebParam(partName = "body", name = "OneRequest",
targetNamespace = "...")
java.lang.String body
);
}
A solution right now for me, is to remove unwanted information from the
paramArray (given in the performInvocation) - but that is not a solution
in the real world.
Have I missed something? Or do you need more information?
-----Oprindelig meddelelse-----
Fra: Willem Jiang [mailto:[EMAIL PROTECTED]
Sendt: 8. august 2007 08:56
Til: Morten Andersen; [email protected]
Emne: Re: Multiple JMS services
Hi ,
I just went through the code, and so did some experiments. JMS's
EndpointInfo is not just came from the Endpoint.publish(address,
implementor);'s address, the jms transportation related info are all
come from wsdl extensions.
So when you use the
EndpointImpl endpoint1 = Endpoint.publish(address, implementor1);
EndpointImpl endpoint2 = Endpoint.publish(address, implementor2);
just like the
https://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/j
ava/org/apache/cxf/systest/versioning/Server.java
will take no effector , and you just get the ChainInitiationObserver
from the endpoint2 server's destination.
My suggestion is you need to do some hack work here.
1. create MultipleEndpointObserver yourself , you can find the sample
code from the SoapBindFactory's addListener(Destination d, Endpoint e).
MultipleEndpointObserver newMO;
MultipleEndpointObserver newMO = new
MultipleEndpointObserver(getBus()) {
@Override
protected Message createMessage(Message message) {
return new SoapMessage(message);
}
};
newMO.getBindingInterceptors().add(new
AttachmentInInterceptor());
newMO.getBindingInterceptors().add(new StaxInInterceptor());
// This will not work if we one of the endpoints disables
message
// processing. But, if you've disabled message processing,
you
// probably aren't going to use this feature.
newMO.getBindingInterceptors().add(new
ReadHeadersInterceptor(getBus()));
// Add in a default selection interceptor
newMO.getRoutingInterceptors().add(new
EndpointSelectionInterceptor());
2. add the first two jms endpoint to the MultipleEndpointObserver's
endpoint set.
newMO.getEndpoints().add(endpoint1.getServer().getEndpoint());
newMO.getEndpoints().add(endpoint2.getServer().getEndpoint());
3. Choice one of the jms endpoint's destination ( which you want
request and response queue), replace the destination's observer with
your MultipleEndpointObserver.
endpoint2.getServer().getDestination().setMessageObserver(newMO);
4. You also need to setup the MediatorInInterceptor for routing work
newMO.getRoutingInterceptors().clear();
newMO.getRoutingInterceptors().add(new MediatorInInterceptor());
Hope this can help you :)
Willem.
[EMAIL PROTECTED] wrote:
Hi
I have tried to follow the example your are pointing at, but without
any luck.
I have downloaded the latest snapshot.
When I am starting the server I got:
org.apache.cxf.transport.ChainInitiationObserver incompatible with
org.apache.cxf.transport.MultipleEndpointObserver
I have tried to "force" a MultipleEnpointObserver on the destination,
but the result of that was the the server just took a random enpoint to
handle the request.
And the logging I have made in the MediatorInInterceptor never showed
up :o(
Willem Jiang-2 wrote:
Hi Andersen,
As you know the Endpoint.publish(address1, implementor1) 's address1
can be any string, and it will take no effect if you just use the jms
transport.
Because the JMS endpoint address information is got from the wsdl.
So back to your question. I just checked the codes, and found the
server-routing.html is out of date :( You can find the latest codes
here.
(in Server.java , you can set the information to the endpoints for
the MediatorInInterceptor to look up)
https://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/tes
t/java/org/apache/cxf/systest/versioning/Server.java
https://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/tes
t/java/org/apache/cxf/systest/versioning/MediatorInInterceptor.java
If you like you can try the trunk version or latest snapshot with
these code.
Willem.
mr.andersen wrote:
Hi
I'm trying to setup a simple server running in a main method.
My goal is to have atleast 2 services, having their own wsdl
definition, but both using the same request and reply JMS queue.
I have tested that both services can be executed and response with
correct information seperatly, but I have some problems when I
publishing 2 services.
First I tried to follow the example in the Users Guide -
http://cwiki.apache.org/CXF20DOC/service-routing.html Service
Routing , but each time the MediatorInInterceptor have found the
correct targetServer, no MessageObserver was available to handle the
message (MessageObserver mo = targetServer.getMessageObserver();
returned a null mo).
My second implementation is like the below, but the server is
picking out a random service to handle the incoming message.
Is there something I have missed? Or does CXF not support multi
services over JMS yet?
Object implementor1 = new OneImpl(); String address1 =
"{http://cxf.apache.org/jms_endpt}OnePort.jms-destination";
Endpoint.publish(address1, implementor1);
Object implementor2 = new AnotherImpl(); String address2 =
"{http://cxf.apache.org/jms_endpt}AnotherPort.jms-destination";
Endpoint.publish(address2, implementor2);
Quoted from:
http://www.nabble.com/Multiple-JMS-services-tf4228402.html#a12031068