You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by raymond <rm...@gmail.com> on 2013/03/15 04:27:10 UTC

How to create SOAP message via using cxf

Hi all,

1.I want to send the soap xml to http server. Currently,my application
already integrate the cxf and spring.
How to generate the whole soap xml in CXF. such as:

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Body>
<ns2:portInStatusQueryResponse >
<return>
<msisdn>60181234567</msisdn>
<rejectCode>SP53</rejectCode>
<rejectReason>The msisdn does not exist.</rejectReason>
<status>SP53</status>
</return>
</ns2:portInStatusQueryResponse>
</soap:Body>
</soap:Envelope>

2.How to change the soap prefix in cxf
<soap:env /> to <SOAP-ENV /> 

Thank you.



--
View this message in context: http://cxf.547215.n5.nabble.com/How-to-create-SOAP-message-via-using-cxf-tp5724600.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: How to create SOAP message via using cxf

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

CXF generate the soap payload based on interface definition(WSDL or SEI),  so if you have the service URL, then generally you can get the WSDL from service URL?wsdl.
For example, the service url is
http://somehost/service
the wsdl is
http://somehost/service?wsdl
-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

On 2013-3-18, at 上午9:48, raymond wrote:

> Hi FreeMan,
> 
> Thank you for your reply.
> 
> 1.Actually, I don't have WSDL or java code.I only get the URL.
> It seems the server implements httpservlet and it is the soap protocol.
> 
> I don't want to use String to build the soap xml.So I want to know how cxf
> generate the soap xml.
> 
> 
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/How-to-create-SOAP-message-via-using-cxf-tp5724600p5724678.html
> Sent from the cxf-user mailing list archive at Nabble.com.


Re: How to create SOAP message via using cxf

Posted by raymond <rm...@gmail.com>.
Hi FreeMan,

Thank you for your reply.

1.Actually, I don't have WSDL or java code.I only get the URL.
It seems the server implements httpservlet and it is the soap protocol.

I don't want to use String to build the soap xml.So I want to know how cxf
generate the soap xml.





--
View this message in context: http://cxf.547215.n5.nabble.com/How-to-create-SOAP-message-via-using-cxf-tp5724600p5724678.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: How to create SOAP message via using cxf

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

The soap message payload is determined by some interface definition(WSDL or java code), I assume you already have it, right?
If so, you can use either WSDL first or code first way to invoke remote webservice using CXF, CXF will generate the soap message based on the service model(generated from wsdl or java class) automatically for you.

And about <soap:env /> to <SOAP-ENV /> , you can use soap.env.ns.map property to specify it, take a look at related discussion to know how

[1]http://cxf.547215.n5.nabble.com/How-to-customize-namespaces-position-and-prefix-in-CXF-response-td3423069.html
-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

On 2013-3-15, at 上午11:27, raymond wrote:

> Hi all,
> 
> 1.I want to send the soap xml to http server. Currently,my application
> already integrate the cxf and spring.
> How to generate the whole soap xml in CXF. such as:
> 
> <?xml version="1.0" encoding="UTF-8"?><soap:Envelope
> xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
> <soap:Body>
> <ns2:portInStatusQueryResponse >
> <return>
> <msisdn>60181234567</msisdn>
> <rejectCode>SP53</rejectCode>
> <rejectReason>The msisdn does not exist.</rejectReason>
> <status>SP53</status>
> </return>
> </ns2:portInStatusQueryResponse>
> </soap:Body>
> </soap:Envelope>
> 
> 2.How to change the soap prefix in cxf
> <soap:env /> to <SOAP-ENV /> 
> 
> Thank you.
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/How-to-create-SOAP-message-via-using-cxf-tp5724600.html
> Sent from the cxf-user mailing list archive at Nabble.com.