Problem invoking on RPC/Literal WSDL

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem invoking on RPC/Literal WSDL

Soltysik, Seumas
I have set up a Server using the following code:

        JaxWsServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean();
        serviceFactory.setBus(bus);
        serviceFactory.setInvoker(new JAXWSMethodInvoker(impl));
        serviceFactory.setServiceClass(impl.getClass());
        serviceFactory.setWsdlURL(wsdlLoc);


        JaxWsServerFactoryBean serverFactory = new JaxWsServerFactoryBean();
        serverFactory.setServiceFactory(serviceFactory);
        serverFactory.setBus(bus);
        serverFactory.setEndpointName(new QName(portName));
        serverFactory.setAddress(address);
        serverFactory.setServiceClass(impl.getClass());
        serverFactory.create();

The following code in BareInInterceptor is throwing an exception:

            if (msgInfo != null && msgInfo.getMessageParts() != null) {
                assert msgInfo.getMessageParts().size() > paramNum;
                p = msgInfo.getMessageParts().get(paramNum);
            } else {
                p = findMessagePart(exchange, ops, elName, client, paramNum);
            }

            if (p == null) {
 ----->               throw new Fault(new org.apache.cxf.common.i18n.Message("NO_PART_FOUND", BUNDLE, elName));
            }

The problem seems to stem from the following code in the AbstractPhaseInterceptor::findMessageParts() call:

            Collection bodyParts = msgInfo.getMessageParts();
            if (bodyParts.size() == 0 || bodyParts.size() <= index) {
                itr.remove();
                continue;
            }

The Web service call is RPC/Literal and there are no IN parts defined in the message defined in the WSDL, so this code passes over the correct operation that it is looking for.

I have a feeling that the problem I am seeing is related to the fact that I am using a RPC/Literal WSDL. Other WSDLs that are Doc/Literal do not seem to have this problem.

Any ideas what is going on?

Thanks,
Seumas



Reply | Threaded
Open this post in threaded view
|

Re: Problem invoking on RPC/Literal WSDL

James Mao
Hi Seumas,

For a JaxWs server i don't think it's necessary  for a user to use the
JaxWsServiceFactoryBean to setup a server, can you explain why?

We do have a demo under samples dir in the latest kit, and it show us
the three well known operation, sayHi() greetMe(String)  
sendReceiveData(ComplexType)
Demo name is hello_world_RPCLit, i think the sayHi operation has no
input as well.
But  i don't know if it's wsdl also looks same or similar.
So can you  provide the wsdl and also create a jira issue.

I also met a strange RPC/Lit problem myself when i pair with a STP guy,
the wsdl used fine in the kit, but fail in the Eclipse.

Thanks,
James.

> I have set up a Server using the following code:
>
>         JaxWsServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean();
>         serviceFactory.setBus(bus);
>         serviceFactory.setInvoker(new JAXWSMethodInvoker(impl));
>         serviceFactory.setServiceClass(impl.getClass());
>         serviceFactory.setWsdlURL(wsdlLoc);
>
>
>         JaxWsServerFactoryBean serverFactory = new JaxWsServerFactoryBean();
>         serverFactory.setServiceFactory(serviceFactory);
>         serverFactory.setBus(bus);
>         serverFactory.setEndpointName(new QName(portName));
>         serverFactory.setAddress(address);
>         serverFactory.setServiceClass(impl.getClass());
>         serverFactory.create();
>
> The following code in BareInInterceptor is throwing an exception:
>
>             if (msgInfo != null && msgInfo.getMessageParts() != null) {
>                 assert msgInfo.getMessageParts().size() > paramNum;
>                 p = msgInfo.getMessageParts().get(paramNum);
>             } else {
>                 p = findMessagePart(exchange, ops, elName, client, paramNum);
>             }
>
>             if (p == null) {
>  ----->               throw new Fault(new org.apache.cxf.common.i18n.Message("NO_PART_FOUND", BUNDLE, elName));
>             }
>
> The problem seems to stem from the following code in the AbstractPhaseInterceptor::findMessageParts() call:
>
>             Collection bodyParts = msgInfo.getMessageParts();
>             if (bodyParts.size() == 0 || bodyParts.size() <= index) {
>                 itr.remove();
>                 continue;
>             }
>
> The Web service call is RPC/Literal and there are no IN parts defined in the message defined in the WSDL, so this code passes over the correct operation that it is looking for.
>
> I have a feeling that the problem I am seeing is related to the fact that I am using a RPC/Literal WSDL. Other WSDLs that are Doc/Literal do not seem to have this problem.
>
> Any ideas what is going on?
>
> Thanks,
> Seumas
>
>
>
>
>  

Reply | Threaded
Open this post in threaded view
|

RE: Problem invoking on RPC/Literal WSDL

Soltysik, Seumas
In reply to this post by Soltysik, Seumas
Hi James,
I am using the JaxWsServiceFactoryBean so that I can set the WSDL location dynamically for the server. I looked at the hello_world_RPCLit.wsdl and cannot see any obvious differences. I am wondering if the problem is related to how I am creating the Server. I am going to compare how the server is create with how it is done in the EndpointImpl class.
Regards,
Seumas


-----Original Message-----
From: James Mao [mailto:[hidden email]]
Sent: Monday, November 20, 2006 9:19 PM
To: [hidden email]
Subject: Re: Problem invoking on RPC/Literal WSDL


Hi Seumas,

For a JaxWs server i don't think it's necessary  for a user to use the
JaxWsServiceFactoryBean to setup a server, can you explain why?

We do have a demo under samples dir in the latest kit, and it show us
the three well known operation, sayHi() greetMe(String)  
sendReceiveData(ComplexType)
Demo name is hello_world_RPCLit, i think the sayHi operation has no
input as well.
But  i don't know if it's wsdl also looks same or similar.
So can you  provide the wsdl and also create a jira issue.

I also met a strange RPC/Lit problem myself when i pair with a STP guy,
the wsdl used fine in the kit, but fail in the Eclipse.

Thanks,
James.

> I have set up a Server using the following code:
>
>         JaxWsServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean();
>         serviceFactory.setBus(bus);
>         serviceFactory.setInvoker(new JAXWSMethodInvoker(impl));
>         serviceFactory.setServiceClass(impl.getClass());
>         serviceFactory.setWsdlURL(wsdlLoc);
>
>
>         JaxWsServerFactoryBean serverFactory = new JaxWsServerFactoryBean();
>         serverFactory.setServiceFactory(serviceFactory);
>         serverFactory.setBus(bus);
>         serverFactory.setEndpointName(new QName(portName));
>         serverFactory.setAddress(address);
>         serverFactory.setServiceClass(impl.getClass());
>         serverFactory.create();
>
> The following code in BareInInterceptor is throwing an exception:
>
>             if (msgInfo != null && msgInfo.getMessageParts() != null) {
>                 assert msgInfo.getMessageParts().size() > paramNum;
>                 p = msgInfo.getMessageParts().get(paramNum);
>             } else {
>                 p = findMessagePart(exchange, ops, elName, client, paramNum);
>             }
>
>             if (p == null) {
>  ----->               throw new Fault(new org.apache.cxf.common.i18n.Message("NO_PART_FOUND", BUNDLE, elName));
>             }
>
> The problem seems to stem from the following code in the AbstractPhaseInterceptor::findMessageParts() call:
>
>             Collection bodyParts = msgInfo.getMessageParts();
>             if (bodyParts.size() == 0 || bodyParts.size() <= index) {
>                 itr.remove();
>                 continue;
>             }
>
> The Web service call is RPC/Literal and there are no IN parts defined in the message defined in the WSDL, so this code passes over the correct operation that it is looking for.
>
> I have a feeling that the problem I am seeing is related to the fact that I am using a RPC/Literal WSDL. Other WSDLs that are Doc/Literal do not seem to have this problem.
>
> Any ideas what is going on?
>
> Thanks,
> Seumas
>
>
>
>
>