nagy.zsolt.hun
nagy.zsolt.hun

Reputation: 6694

java - apache cxf client without wsdl

I'm trying to send a really simple soap request using Apache CXF in Java: a message with only 1 element:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Body>
        <element>some string</element>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The following tutorial describes usage of CXF for sending requests but it assumes that we have a WSDL file: http://cxf.apache.org/docs/how-do-i-develop-a-client.html

What should I do in case I don't have this WSDL? should I create one? how would it look like in this case?

edit: the service is not maintained by me.

Upvotes: 4

Views: 7719

Answers (1)

kingAm
kingAm

Reputation: 1753

The tutorial, you are looking is meant to produce a client. That means, your webservice will be existing or hosted on as server already. Your client will simply call it using this tutorial.

What you are looking for, CXF's JAX WS API implementation for your requirement. You can follow these basic tutorial to achieve that by simply using annotation and changing request and response message structue.

Tutorial links:

http://www.mkyong.com/webservices/jax-ws/jax-ws-hello-world-example/

http://java.dzone.com/articles/jax-ws-hello-world

Upvotes: 2

Related Questions