You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by tj_8 <hi...@live.com> on 2013/06/11 06:41:58 UTC

Xfire to CXF - Backwards compatiblity

Hello,
I have upgraded out webservice from XFire to CXF 2.3.2
We are trying  if the same old soap request could be used to hit the new CXF
service, having no impact to the client. I was able to comeup with such a
implementation that I can use the same soap request but the response I am
getting is different with respect to the namespace. Any pointer how I can
get this aligned.

Below I have the soap request and the two responses. one from the old XFIRE
and one from the new CXF. Also my annotation configuration and the JAXB
package-info.java

Soap Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:web="http://webservice.lastPCP.com"
xmlns:ser="http://service.lastPCP.com">
   <soapenv:Header/>
   <soapenv:Body>
      <web:getLastPCP>
         <web:in0>           
            <ser:searchAcross>false</ser:searchAcross>
            <ser:memberKey>7Mt</ser:memberKey>
         </web:in0>
      </web:getLastPCP>
   </soapenv:Body>
</soapenv:Envelope>

SOAP Response: XFIRE

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soap:Body>
      <ns1:getLastPCPResponse xmlns:ns1="http://webservice.lastPCP.com">
         <ns1:out>
            <pIdQualifier xmlns="http://service.lastPCP.com"></pIdQualifier>
            <pId xmlns="http://service.lastPCPcom">102866</pId>
         </ns1:out>
      </ns1:getLastPCPResponse>
   </soap:Body>
</soap:Envelope>

SOAP Response: CXF

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns3:getLastPCPResponse xmlns:ns3="http://webservice.lastPCP.com/"
xmlns:ns2="http://service.lastPCP.com"
xmlns:web="http://webservice.lastPCP.com">
         <ns3:out>
            <ns2:pId>102866</ns2:pId>
            <ns2:pIdQualifier></ns2:pIdQualifier>
         </ns3:out>
      </ns3:getLastPCPResponse>
   </soap:Body>
</soap:Envelope>

Service Annotation

@WebService
@SOAPBinding(style = Style.DOCUMENT, use=Use.LITERAL, parameterStyle =
ParameterStyle.WRAPPED )
public interface LastPCPService {
    
	
	@WebMethod(action="getLastPCP", operationName="getLastPCP")
	@WebResult(name="out")
    LastPCPRes getLastPCP(@WebParam(name = "in0")LastPCPReq request) ;
}

PACKAGE-INFO.JAVA

@javax.xml.bind.annotation.XmlSchema(
	namespace = "http://service.lastPCP.com", 
        xmlns = { 
			@javax.xml.bind.annotation.XmlNs( prefix = "web",
                  namespaceURI = "http://webservice.lastPCP.com" )},
	elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)


package com.lastPCP.webservice;

THanks for your help.





--
View this message in context: http://cxf.547215.n5.nabble.com/Xfire-to-CXF-Backwards-compatiblity-tp5729084.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Xfire to CXF - Backwards compatiblity

Posted by Daniel Kulp <dk...@apache.org>.
Definitely use a more recent version of CXF.   2.3.2 is ancient.

Anyway, the main difference between the messages is the namespace.   XFire uses http://webservice.lastPCP.com whereas CXF uses http://webservice.lastPCP.com/  (note the trailing /).   My suggestion is to add the namespace attribute to the various @WebService annotations to force it to whichever you need/expect.

Dan


On Jun 11, 2013, at 12:41 AM, tj_8 <hi...@live.com> wrote:

> Hello,
> I have upgraded out webservice from XFire to CXF 2.3.2
> We are trying  if the same old soap request could be used to hit the new CXF
> service, having no impact to the client. I was able to comeup with such a
> implementation that I can use the same soap request but the response I am
> getting is different with respect to the namespace. Any pointer how I can
> get this aligned.
> 
> Below I have the soap request and the two responses. one from the old XFIRE
> and one from the new CXF. Also my annotation configuration and the JAXB
> package-info.java
> 
> Soap Request:
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:web="http://webservice.lastPCP.com"
> xmlns:ser="http://service.lastPCP.com">
>   <soapenv:Header/>
>   <soapenv:Body>
>      <web:getLastPCP>
>         <web:in0>           
>            <ser:searchAcross>false</ser:searchAcross>
>            <ser:memberKey>7Mt</ser:memberKey>
>         </web:in0>
>      </web:getLastPCP>
>   </soapenv:Body>
> </soapenv:Envelope>
> 
> SOAP Response: XFIRE
> 
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>   <soap:Body>
>      <ns1:getLastPCPResponse xmlns:ns1="http://webservice.lastPCP.com">
>         <ns1:out>
>            <pIdQualifier xmlns="http://service.lastPCP.com"></pIdQualifier>
>            <pId xmlns="http://service.lastPCPcom">102866</pId>
>         </ns1:out>
>      </ns1:getLastPCPResponse>
>   </soap:Body>
> </soap:Envelope>
> 
> SOAP Response: CXF
> 
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>   <soap:Body>
>      <ns3:getLastPCPResponse xmlns:ns3="http://webservice.lastPCP.com/"
> xmlns:ns2="http://service.lastPCP.com"
> xmlns:web="http://webservice.lastPCP.com">
>         <ns3:out>
>            <ns2:pId>102866</ns2:pId>
>            <ns2:pIdQualifier></ns2:pIdQualifier>
>         </ns3:out>
>      </ns3:getLastPCPResponse>
>   </soap:Body>
> </soap:Envelope>
> 
> Service Annotation
> 
> @WebService
> @SOAPBinding(style = Style.DOCUMENT, use=Use.LITERAL, parameterStyle =
> ParameterStyle.WRAPPED )
> public interface LastPCPService {
> 
> 	
> 	@WebMethod(action="getLastPCP", operationName="getLastPCP")
> 	@WebResult(name="out")
>    LastPCPRes getLastPCP(@WebParam(name = "in0")LastPCPReq request) ;
> }
> 
> PACKAGE-INFO.JAVA
> 
> @javax.xml.bind.annotation.XmlSchema(
> 	namespace = "http://service.lastPCP.com", 
>        xmlns = { 
> 			@javax.xml.bind.annotation.XmlNs( prefix = "web",
>                  namespaceURI = "http://webservice.lastPCP.com" )},
> 	elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
> 
> 
> package com.lastPCP.webservice;
> 
> THanks for your help.
> 
> 
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Xfire-to-CXF-Backwards-compatiblity-tp5729084.html
> Sent from the cxf-user mailing list archive at Nabble.com.

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: Xfire to CXF - Backwards compatiblity

Posted by Glen Mazza <gl...@gmail.com>.
Unsure, but CXF 2.3.x is long dead, so you might wish to work with a 
supported version since you're upgrading anyway (say CXF 2.7.5).

Glen

On 06/11/2013 12:41 AM, tj_8 wrote:
> Hello,
> I have upgraded out webservice from XFire to CXF 2.3.2
> We are trying  if the same old soap request could be used to hit the new CXF
> service, having no impact to the client. I was able to comeup with such a
> implementation that I can use the same soap request but the response I am
> getting is different with respect to the namespace. Any pointer how I can
> get this aligned.
>
> Below I have the soap request and the two responses. one from the old XFIRE
> and one from the new CXF. Also my annotation configuration and the JAXB
> package-info.java
>
> Soap Request:
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:web="http://webservice.lastPCP.com"
> xmlns:ser="http://service.lastPCP.com">
>     <soapenv:Header/>
>     <soapenv:Body>
>        <web:getLastPCP>
>           <web:in0>
>              <ser:searchAcross>false</ser:searchAcross>
>              <ser:memberKey>7Mt</ser:memberKey>
>           </web:in0>
>        </web:getLastPCP>
>     </soapenv:Body>
> </soapenv:Envelope>
>
> SOAP Response: XFIRE
>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>     <soap:Body>
>        <ns1:getLastPCPResponse xmlns:ns1="http://webservice.lastPCP.com">
>           <ns1:out>
>              <pIdQualifier xmlns="http://service.lastPCP.com"></pIdQualifier>
>              <pId xmlns="http://service.lastPCPcom">102866</pId>
>           </ns1:out>
>        </ns1:getLastPCPResponse>
>     </soap:Body>
> </soap:Envelope>
>
> SOAP Response: CXF
>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>     <soap:Body>
>        <ns3:getLastPCPResponse xmlns:ns3="http://webservice.lastPCP.com/"
> xmlns:ns2="http://service.lastPCP.com"
> xmlns:web="http://webservice.lastPCP.com">
>           <ns3:out>
>              <ns2:pId>102866</ns2:pId>
>              <ns2:pIdQualifier></ns2:pIdQualifier>
>           </ns3:out>
>        </ns3:getLastPCPResponse>
>     </soap:Body>
> </soap:Envelope>
>
> Service Annotation
>
> @WebService
> @SOAPBinding(style = Style.DOCUMENT, use=Use.LITERAL, parameterStyle =
> ParameterStyle.WRAPPED )
> public interface LastPCPService {
>      
> 	
> 	@WebMethod(action="getLastPCP", operationName="getLastPCP")
> 	@WebResult(name="out")
>      LastPCPRes getLastPCP(@WebParam(name = "in0")LastPCPReq request) ;
> }
>
> PACKAGE-INFO.JAVA
>
> @javax.xml.bind.annotation.XmlSchema(
> 	namespace = "http://service.lastPCP.com",
>          xmlns = {
> 			@javax.xml.bind.annotation.XmlNs( prefix = "web",
>                    namespaceURI = "http://webservice.lastPCP.com" )},
> 	elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
>
>
> package com.lastPCP.webservice;
>
> THanks for your help.
>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Xfire-to-CXF-Backwards-compatiblity-tp5729084.html
> Sent from the cxf-user mailing list archive at Nabble.com.