You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by philgmo <ph...@gmail.com> on 2008/05/09 08:17:21 UTC
Client without a WSDL?
I apologize if this has been answered before. I tried searching, but haven't
found exactly what I'm looking for.
I'm trying to implement a client to a SOAP service that doesn't need to load
the WSDL file. I've generated stub client classes with wsdl2java (using cxf
2.0.5).
This is basically what I'm doing...
QName serviceName = new QName("http://www.blah.org", "MyService");
MyService service = new MyService(null, serviceName);
QName portName = new QName("http://www.blah.org", "MyPort");
service.addPort(portName, "http://schemas.xmlsoap.org/soap/", portURL);
PortType myPort = service.getPort(portName, PortType.class);
When I try calling a method on myPort, I get an exception:
javax.xml.ws.soap.SOAPFaultException: Found element metadata but could not
find matching RPC/Literal part
When I debug and look at the fields of service, I see that after running
addPort, it adds a record to the service.portInfos map, but not
service.ports. Any help would be greatly appreciated!
Thanks.
--
View this message in context: http://www.nabble.com/Client-without-a-WSDL--tp17141977p17141977.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Client without a WSDL?
Posted by philgmo <ph...@gmail.com>.
Vijay Allam wrote:
>
> Here is the stub that works
>
>
> private static final QName SERVICE_NAME = new
> QName("http://blah.com","MyService");
> private static final QName PORT_NAME = new QName("http://blah.com",
> "MyPort");
>
> javax.xml.ws.Service service = Service.create(SERVICE_NAME);
> service.addPort(PORT_NAME,
> avax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING,
> portUrl);
>
> MyService port = service.getPort(PORT_NAME,MyService .class);
>
Thanks for your help, but I'm still getting an exception when I try this:
javax.xml.ws.soap.SOAPFaultException: Found element metadata but could not
find matching RPC/Literal part
at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:211)
--
View this message in context: http://www.nabble.com/Client-without-a-WSDL--tp17141977p17150590.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Client without a WSDL?
Posted by Vijay Allam <vi...@revolutionhealth.com>.
Here is the stub that works
private static final QName SERVICE_NAME = new
QName("http://blah.com","MyService");
private static final QName PORT_NAME = new QName("http://blah.com",
"MyPort");
javax.xml.ws.Service service = Service.create(SERVICE_NAME);
service.addPort(PORT_NAME, avax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING,
portUrl);
MyService port = service.getPort(PORT_NAME,MyService .class);
--Vijay
On 5/9/08 2:17 AM, "philgmo" <ph...@gmail.com> wrote:
>
> I apologize if this has been answered before. I tried searching, but haven't
> found exactly what I'm looking for.
>
> I'm trying to implement a client to a SOAP service that doesn't need to load
> the WSDL file. I've generated stub client classes with wsdl2java (using cxf
> 2.0.5).
>
> This is basically what I'm doing...
>
> QName serviceName = new QName("http://www.blah.org", "MyService");
> MyService service = new MyService(null, serviceName);
>
> QName portName = new QName("http://www.blah.org", "MyPort");
> service.addPort(portName, "http://schemas.xmlsoap.org/soap/", portURL);
> PortType myPort = service.getPort(portName, PortType.class);
>
> When I try calling a method on myPort, I get an exception:
> javax.xml.ws.soap.SOAPFaultException: Found element metadata but could not
> find matching RPC/Literal part
>
> When I debug and look at the fields of service, I see that after running
> addPort, it adds a record to the service.portInfos map, but not
> service.ports. Any help would be greatly appreciated!
>
> Thanks.