I tried 3 options 1) Creating provider 2) static valudOf method 3)
Constructor of AuthHeader with String argument. At least..previous
error(s) gone away, but, my values are not being set. Even I added some
logging statements. Those were not printed. I am nullpointer exception
whenever I tried to access it inside the body of implementing method. Is
there any working example..that I can refer to in CXF?

Interface method
---------------
 @Path("/getorderpaymentmethod3")
    @POST
    public GetOrderPaymentMethodResponse getOrderPaymentMethod3( 
                                             OrderRequest
partGetOrderPaymentMethodRequest,
                                   @HeaderParam("AuthHeader")
com.stubhub.webservices.common.AuthHeader authHeader)
 
throws StubHubFault;
        


AuthHeader method and constructor
-----------------------------------
        public AuthHeader(String s){
                super();
        
System.out.println("**************************|||||||||||");
                System.out.println("String s:" + s);
        setUserId(10077L);
        }
        
        public static AuthHeader valueOf(String s){
        
System.out.println("**************************|||||||||||");
                System.out.println("String s:" + s);
                AuthHeader a = new AuthHeader();
                a.setUserId(10077L);
                return a;
        }       

Getting nullpointer at this line:
                        RequestContext requestContext = new
RequestContext();
        
requestContext.setUserId(authHeader.getUserId()); ---> here null pointer
exception

Error:
----
INFO: Inbound Message
----------------------------
ID: 1
Address:
/paymentapi/stubHubPaymentJaxwsJaxrs_rest/payment/getorderpaymentmethod3
Encoding: ISO-8859-1
Content-Type: application/xml
Headers: {content-length=[57], userid=[10077],
accept-encoding=[gzip,deflate], host=[10.249.136.95:28080],
user-agent=[J
akarta Commons-HttpClient/3.1], Content-Type=[application/xml],
content-type=[application/xml]}
Payload: <OrderRequest><orderId>23544619</orderId>
</OrderRequest>
--------------------------------------
18:16:41,235 ERROR [StubHubPaymentImpl] Exception happened
java.lang.NullPointerException
        at
com.stubhub.api.payment.StubHubPaymentJaxwsJaxrsImpl.getOrderPaymentMeth
od3(StubHubPaymentJaxwsJaxrsImpl.java
:209)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(Abstrac
tInvoker.java:166)

Regards
Karuna Pydipati
StubHub/eBay - Platform & Services
Phone: (415)222-8752
Email: [email protected]

 


-----Original Message-----
From: Sergey Beryozkin [mailto:[email protected]] 
Sent: Wednesday, November 18, 2009 2:48 PM
To: Sergey Beryozkin; [email protected]
Subject: RE: Deploying JAXWS&JAXRS together - error

Sorry, I'm misleading you. It is @HeaderParam.
Also you can avoid creating ParameterHandler if AuthHeader class can
have a static valueOf(String) or a string based constructor.
Please review the CXF JAXRS docs
Thanks, Sergey

From: Sergey Beryozkin
Sent: 18 November 2009 22:35
To: '[email protected]'
Subject: RE: Deploying JAXWS&JAXRS together - error

It is a wrong annotation, should a jaxrs @HttpHeader

-----Original Message-----
From: Pydipati, Karuna [mailto:[email protected]]
Sent: 18 November 2009 22:17
To: [email protected]
Subject: RE: Deploying JAXWS&JAXRS together - error

Makes sense. 

Is there any documentation or example as to how to create a
ParameterHandler<AuthHeader> and register as jaxrs provider? My
application is heavily dependent on Spring. I am fine to add spring
configuration OR annotation based.

I created a the following Provider 

public class AuthHeaderProvider implements ParameterHandler<AuthHeader>
{
    static protected final Log log =
LogFactory.getLog(AuthHeaderProvider.class);
    public AuthHeader fromString(String s) {
        AuthHeader c = new AuthHeader();
        log.info("String s:" + s);
        c.setUserId(10077L);
        return c;
    }
}

Also added config info like this

<bean id="stubHubPaymentJaxwsJaxrsImpl"
class="com.stubhub.api.payment.StubHubPaymentJaxwsJaxrsImpl" />
        
<jaxws:endpoint 
          id="StubHubPaymentJaxwsJaxrs" 
        
implementorClass="com.stubhub.api.payment.StubHubPaymentJaxwsJaxrsImpl"
          implementor="#stubHubPaymentJaxwsJaxrsImpl" 
          address="/StubHubPaymentJaxwsJaxrs"/>
          
<jaxrs:server id="StubHubPaymentJaxwsJaxrsRest"
address="/stubHubPaymentJaxwsJaxrs_rest">
                <jaxrs:serviceBeans>    
                        <ref bean="stubHubPaymentJaxwsJaxrsImpl" />
                </jaxrs:serviceBeans>
            <jaxrs:providers>
              <ref bean="authProvider" />
            </jaxrs:providers>
</jaxrs:server>
        
<bean id="authProvider"
class="com.stubhub.webservices.common.AuthHeaderProvider"/>

Now, the interface is not accepting
@org.codehaus.jra.HttpHeader("AuthHeader") the way you suggested. That
annotation is not accepting any string to that annotation. BTW, I am
using cxf2.2.3. SO, I tried with this interface

   @Path("/getorderpaymentmethod3")
    @POST
    public GetOrderPaymentMethodResponse getOrderPaymentMethod3(
 
OrderRequest partGetOrderPaymentMethodRequest,
 
@HttpHeader com.stubhub.webservices.common.AuthHeader authHeader)
 
throws StubHubFault;
It still FAILS.  How do I code like HttpHeader("AuthHeader") annotaion?
It is giving compile error in eclipse.

INFO: Inbound Message
----------------------------
ID: 4
Address:
/paymentapi/stubHubPaymentJaxwsJaxrs_rest/payment/getorderpaymentmethod
Encoding: ISO-8859-1
Content-Type: application/xml
Headers: {content-length=[57], userid=[10077],
accept-encoding=[gzip,deflate], host=[10.249.136.95:28080],
user-agent=[J akarta Commons-HttpClient/3.1],
Content-Type=[application/xml], content-type=[application/xml]}
Payload: <OrderRequest><orderId>23544619</orderId>
</OrderRequest>
--------------------------------------
13:52:35,594 ERROR [STDERR] Nov 18, 2009 1:52:35 PM
org.apache.cxf.jaxrs.provider.AbstractJAXBProvider handleJAXBExcepti on
WARNING: javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException: Premature end of file.]
        at
javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException
(AbstractUnmarshallerImpl.java:315)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarsha
lException(UnmarshallerImpl.java:506)

        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(Unm
arshallerImpl.java:215)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(Unma
rshallerImpl.java:184)
        at
javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmars
hallerImpl.java:137)
        at
javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmars
hallerImpl.java:184)
        at
org.apache.cxf.jaxrs.provider.JAXBElementProvider.unmarshalFromInputStre
am(JAXBElementProvider.java:193)
        at
org.apache.cxf.jaxrs.provider.JAXBElementProvider.doUnmarshal(JAXBElemen
tProvider.java:176)
        at
org.apache.cxf.jaxrs.provider.JAXBElementProvider.readFrom(JAXBElementPr
ovider.java:150)


Regards
Karuna Pydipati
StubHub/eBay - Platform & Services
Phone: (415)222-8752
Email: [email protected]

 


-----Original Message-----
From: Sergey Beryozkin [mailto:[email protected]]
Sent: Wednesday, November 18, 2009 12:26 PM
To: [email protected]
Subject: RE: Deploying JAXWS&JAXRS together - error

Hi

Thanks for confirming it. In fact, it occurred to me on the way back
home that you posted AuthHeader being a JAXB bean.
You see, as I noted in the earlier post, when you were asking how to
handle AuthHeader in a RESTful call, in SOAP you have an envelope which
wraps two XML fragments, like AuthHeader (as a SOAP header) and the
actual body.

When you do HTTP invocations without SOAP, you have to pass headers as
HTTP headers values. The payload you're sending is just an invalid XML
because it has no a top level element, you just have two siblings,
AuthHeader and OrderRequest.

Another thing is that JAXRS does not allow for multiple methods
parameters which are assumed to be request bodies, have a look please
here :
http://cwiki.apache.org/CXF20DOC/jax-rs.html#JAX-RS-DealingwithParameter
s

So, as I suggested you earlier on, you also need to annotate AuthHeader
with @HeaderPaream("AuthHeader") and register a custom
ParameterHandler<AuthHeader> implementation (as a jaxrs provider).

And you'll need to pass AuthHeader as an HTTP header, possibly using
name/value pairs. Finally, your handler will parse this value and
convert it into AuthHeader instance

Hope it helps
Sergey 



-----Original Message-----
From: Pydipati, Karuna [mailto:[email protected]]
Sent: 18 November 2009 20:12
To: [email protected]
Subject: RE: Deploying JAXWS&JAXRS together - error

After lots of trial and error, here is what I found. Still, I could not
solve this issue.

When I have the interface function like this, it WORKS. Please note that
it has only one argument.

    @Path("/getorderpaymentmethod2")
    @POST
    public GetOrderPaymentMethodResponse getOrderPaymentMethod2(
OrderRequest partGetOrderPaymentMethodRequest ) throws SomeThingFault;
Here is the payload, I am sending.
<OrderRequest>
<orderId>23544619</orderId>
</OrderRequest>


When I have the interface function like this, it FAILS. Please note that
it has 2 arguments. Probably, I don't know as to how to send the payload
when there are 2 arguments (2 Objects) in REST calls.

    @Path("/getorderpaymentmethod3")
    @POST
    public GetOrderPaymentMethodResponse
getOrderPaymentMethod3(OrderRequest partGetOrderPaymentMethodRequest,
 
com.xxxxx.webservices.common.AuthHeader authHeader)throws
SomeThingFault; Here is the payload, I am sending.
<AuthHeader>
<userId>10077</userId>
</AuthHeader>
<OrderRequest>
<orderId>23544619</orderId>
</OrderRequest>

OrderRequest.java
-----------------
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "orderRequest", propOrder = { "orderId" })
@XmlRootElement(name = "OrderRequest") public class OrderRequest {

        @XmlElement(required = true)
        protected Long orderId;

        public Long getOrderId() {
                return orderId;
        }

        public void setOrderId(Long value) {
                this.orderId = value;
        }
}

AuthHeader.java
----------------
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "authHeader", propOrder = { "userId" })
@XmlRootElement(name = "AuthHeader") public class AuthHeader {
    @XmlElement(name = "UserId", required = true)
        protected Long userId;

        public Long getUserId() {
                return userId;
        }
        public void setUserId(Long userId) {
                this.userId = userId;
        }
}

Here is the interface
--------------------
@Path("/payment")
@Consumes( { "application/xml" })
@Produces( {  "application/xml" })
@WebService(targetNamespace = "http://payment.api.xxxxx.com/";, name =
"payment/SomeThingPaymentJaxwsJaxrs")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@WebFault(targetNamespace = "http://payment.api.xxxxx.com/";, name =
"SomeThingFault", faultBean = "SomeThingFault") public interface
SomeThingPaymentJaxwsJaxrs {
        
    
    @WebMethod
    @POST
    @Path("/getorderpaymentmethod")
    @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
    @WebResult(targetNamespace = "http://payment.api.xxxxx.com/";,
partName = "partGetOrderPaymentMethodResponse", name =
"getOrderPaymentMethodResponse")
    public GetOrderPaymentMethodResponse getOrderPaymentMethod(
 
@WebParam(partName = "partGetOrderPaymentMethodRequest", name =
"getOrderPaymentMethodRequest", targetNamespace =
"http://payment.api.xxxxx.com/";)
 
OrderRequest partGetOrderPaymentMethodRequest,
 
@WebParam(targetNamespace = "http://payment.api.xxxxx.com/";, name =
"AuthHeader", header = true, partName = "AuthHeader")
 
com.xxxxx.webservices.common.AuthHeader authHeader)
 
throws SomeThingFault;
    @WebMethod
    @POST
    @Path("/setorderpaymentterm")
    @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
    @WebResult(targetNamespace = "http://payment.api.xxxxx.com/";,
partName = "partSetOrderPaymentTermResponse", name =
"setOrderPaymentTermResponse")
    public DetailsResponse setOrderPaymentTerm(
                                               @WebParam(partName =
"partSetOrderPaymentTermRequest", name = "setOrderPaymentTermRequest",
targetNamespace = "http://payment.api.xxxxx.com/";)
 
SetOrderPaymentTermRequest partSetOrderPaymentTermRequest,
                                               @WebParam(targetNamespace
= "http://payment.api.xxxxx.com/";, name = "AuthHeader", header = true,
partName = "AuthHeader")
 
com.xxxxx.webservices.common.AuthHeader authHeader) throws
SomeThingFault;
    
    @Path("/getorderpaymentmethod2")
    @POST
    public GetOrderPaymentMethodResponse getOrderPaymentMethod2(
 
OrderRequest partGetOrderPaymentMethodRequest )
 
throws SomeThingFault;

    @Path("/getorderpaymentmethod3")
    @POST
    public GetOrderPaymentMethodResponse getOrderPaymentMethod3(
 
OrderRequest partGetOrderPaymentMethodRequest,
 
com.xxxxx.webservices.common.AuthHeader authHeader)
 
throws SomeThingFault;
        

}

Here is cxf-bean.xml file definition
-------------------------------------
<bean id="someThingPaymentJaxwsJaxrsImpl"
class="com.xxx.api.payment.SomeThingPaymentJaxwsJaxrsImpl" />
        
<jaxws:endpoint 
          id="SomeThingPaymentJaxwsJaxrs" 
        
implementorClass="com.xxx.api.payment.SomeThingPaymentJaxwsJaxrsImpl"
          implementor="#someThingPaymentJaxwsJaxrsImpl" 
          address="/SomeThingPaymentJaxwsJaxrs"/>
          
<jaxrs:server id="SomeThingPaymentJaxwsJaxrsRest"
address="/someThingPaymentJaxwsJaxrs_rest">
                <jaxrs:serviceBeans>    
                        <ref bean="ssomeThingPaymentJaxwsJaxrsImpl" />
                </jaxrs:serviceBeans>
</jaxrs:server>

Regards
Karuna Pydipati
StubHub/eBay - Platform & Services
Phone: (415)222-8752
Email: [email protected]



-----Original Message-----
From: Sergey Beryozkin [mailto:[email protected]]
Sent: Wednesday, November 18, 2009 9:41 AM
To: [email protected]
Subject: Re: Deploying JAXWS&JAXRS together - error

I'm sorry, but I have no idea what is going on. This time it's actually
a different exception, it seems that the stream had already been read by
the time Unmarshaller tried to read...

Lets step back a bit and try to narrow the problem.
How about you temporarily removing JAXWS annotations altogether and try
to post OrderRequest  ? Still does not work ? Then can you please send
me the test case (that is have a resource class with JAXRS annotations
only and Spring config with jaxrs:server)

thanks, Sergey


----- Original Message -----
From: "Pydipati, Karuna" <[email protected]>
To: <[email protected]>
Sent: Wednesday, November 18, 2009 5:27 PM
Subject: RE: Deploying JAXWS&JAXRS together - error


I tried all possible combinations. This one is failing with different
error. I never felt so difficulty with REST on CXF. This appears to be
very simple one. But, it is taking most of my energy.
Is it because I have annotated interface with both JAX-WS and JAX-RS?


09:23:31,125 ERROR [STDERR] Nov 18, 2009 9:23:31 AM
org.apache.cxf.interceptor.LoggingInInterceptor logging
INFO: Inbound Message
----------------------------
ID: 2
Address:
/paymentapi/stubHubPaymentJaxwsJaxrs_rest/payment/getorderpaymentmethod
Encoding: ISO-8859-1
Content-Type: application/xml
Headers: {content-length=[58], accept-encoding=[gzip,deflate],
host=[10.249.136.95:28080], user-agent=[Jakarta Commons-H
ttpClient/3.1], Content-Type=[application/xml],
content-type=[application/xml]}
Payload: <OrderRequest>
<orderId>23544619</orderId>
</OrderRequest>
--------------------------------------
09:23:31,172 ERROR [STDERR] Nov 18, 2009 9:23:31 AM
org.apache.cxf.jaxrs.provider.AbstractJAXBProvider handleJAXBExcepti on
WARNING: javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException: Premature end of file.]
        at
javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException
(AbstractUnmarshallerImpl.java:315)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarsha
lException(UnmarshallerImpl.java:506)

        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(Unm
arshallerImpl.java:215)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(Unma
rshallerImpl.java:184)
        at
javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmars
hallerImpl.java:137)
        at
javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmars
hallerImpl.java:184)
        at
org.apache.cxf.jaxrs.provider.JAXBElementProvider.unmarshalFromInputStre
am(JAXBElementProvider.java:193)
        at
org.apache.cxf.jaxrs.provider.JAXBElementProvider.doUnmarshal(JAXBElemen
tProvider.java:176)
        at
org.apache.cxf.jaxrs.provider.JAXBElementProvider.readFrom(JAXBElementPr
ovider.java:150)
        at
org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBody(JAXRSUtils.jav
a:861)
        at
org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:4
94)



Regards
Karuna Pydipati
StubHub/eBay - Platform & Services
Phone: (415)222-8752
Email: [email protected]




-----Original Message-----
From: Sergey Beryozkin [mailto:[email protected]]
Sent: Wednesday, November 18, 2009 9:18 AM
To: [email protected]
Subject: Re: Deploying JAXWS&JAXRS together - error

You have @XmlRootElement(name = "OrderRequest")

I didn't pay any attention to it,

<OrderRequest>
<orderId>23544619</orderId>
</OrderRequest>

should do. It's really a JAXB issue

cheers, Sergey



----- Original Message -----
From: "Pydipati, Karuna" <[email protected]>
To: <[email protected]>
Sent: Wednesday, November 18, 2009 5:07 PM
Subject: RE: Deploying JAXWS&JAXRS together - error


I tried that too. I am getting this exception.

09:05:44,793 ERROR [STDERR] Nov 18, 2009 9:05:44 AM
org.apache.cxf.interceptor.LoggingInInterceptor logging
INFO: Inbound Message
----------------------------
ID: 2
Address:
/paymentapi/stubHubPaymentJaxwsJaxrs_rest/payment/getorderpaymentmethod
Encoding: ISO-8859-1
Content-Type: application/xml
Headers: {content-length=[58], accept-encoding=[gzip,deflate],
host=[10.249.136.95:28080], user-agent=[Jakarta Commons-H
ttpClient/3.1], Content-Type=[application/xml],
content-type=[application/xml], Accept=[application/xml]}
Payload: <orderRequest>
<orderId>23544619</orderId>
</orderRequest>
--------------------------------------
09:05:44,856 ERROR [STDERR] Nov 18, 2009 9:05:44 AM
org.apache.cxf.jaxrs.provider.AbstractJAXBProvider handleJAXBExcepti on
WARNING: javax.xml.bind.UnmarshalException: unexpected element (uri:"",
local:"orderRequest"). Expected elements are <{}
OrderRequest>
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEven
t(UnmarshallingContext.java:603)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:
244)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:
239)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildEle
ment(Loader.java:116)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRoo
tLoader.childElement(UnmarshallingCon
text.java:1009)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElem
ent(UnmarshallingContext.java:446)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startEleme
nt(UnmarshallingContext.java:427)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXCo
nnector.java:137)
        at
org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
        at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
        at
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scan
RootElementHook(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
patcher.dispatch(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno
wn Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)


Regards
Karuna Pydipati
StubHub/eBay - Platform & Services
Phone: (415)222-8752
Email: [email protected]




-----Original Message-----
From: Sergey Beryozkin [mailto:[email protected]]
Sent: Wednesday, November 18, 2009 4:48 AM
To: [email protected]
Subject: Re: Deploying JAXWS&JAXRS together - error

Hi

You have the following payload

<getOrderPaymentMethodRequest>
<orderId>23544619</orderId>      </getOrderPaymentMethodRequest>

but it only works for SOAP as the JAXWS runtime ensures the Orderrequest
bean is populated out of thid request XML...

for plain HTTP invocations it has to be something like

<orderRequest>
<orderId>23544619</orderId>
</orderRequest>

cheers, Sergey


----- Original Message -----
From: "Pydipati, Karuna" <[email protected]>
To: <[email protected]>
Sent: Wednesday, November 18, 2009 3:26 AM
Subject: RE: Deploying JAXWS&JAXRS together - error


I have this JAXWS-JAXRS method. SOAP call is working fine. When I try to
call do REST call, it is failing. Probably, I am not sending the POST
payload properly. Do you guys have any clue? I copied the
OrderRequest.java at the end.

 @WebMethod
    @POST
    @Path("/getorderpaymentmethod")
    @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
    @WebResult(targetNamespace = "http://payment.api.xxxxx.com/";,
partName = "partGetOrderPaymentMethodResponse", name =
"getOrderPaymentMethodResponse")

public GetOrderPaymentMethodResponse getOrderPaymentMethod(
@WebParam(partName = "partGetOrderPaymentMethodRequest",
name = "getOrderPaymentMethodRequest",
targetNamespace = "http://payment.api.xxxxx.com/";) OrderRequest
partGetOrderPaymentMethodRequest,

@WebParam(targetNamespace = "http://payment.api.xxxxx.com/";, name =
"AuthHeader", header = true, partName = "AuthHeader")
com.xxxxx.webservices.common.AuthHeader authHeader) throws xxxxxFault;

--------------------------------------
19:12:15,583 ERROR [STDERR] Nov 17, 2009 7:12:15 PM
org.apache.cxf.interceptor.LoggingInInterceptor logging
INFO: Inbound Message
----------------------------
ID: 25
Address:
/paymentapi/stubHubPaymentJaxwsJaxrs_rest/payment/getorderpaymentmethod
Encoding: ISO-8859-1
Content-Type: application/xml
Headers: {content-length=[109], connection=[keep-alive],
cache-control=[no-cache], host=[10.249.136.95:28080], user-agen
t=[Java/1.5.0_14], pragma=[no-cache], Content-Type=[application/xml],
content-type=[application/xml], Accept=[text/html,  image/gif,
image/jpeg, *; q=.2, */*; q=.2], content-language=[en-US]}
Payload:       <getOrderPaymentMethodRequest>
<orderId>23544619</orderId>      </getOrderPaymentMethodRequest>
--------------------------------------
19:12:15,583 ERROR [STDERR] Nov 17, 2009 7:12:15 PM
org.apache.cxf.jaxrs.provider.AbstractJAXBProvider handleJAXBExcepti on
WARNING: javax.xml.bind.UnmarshalException: unexpected element (uri:"",
local:"getOrderPaymentMethodRequest"). Expected elements are
<{}OrderRequest>
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEven
t(UnmarshallingContext.java:603)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:
244)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:
239)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildEle
ment(Loader.java:116)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRoo
tLoader.childElement(UnmarshallingCon
text.java:1009)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElem
ent(UnmarshallingContext.java:446)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startEleme
nt(UnmarshallingContext.java:427)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXCo
nnector.java:137)
        at
org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
        at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
        at
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scan
RootElementHook(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
patcher.dispatch(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno
wn Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
        at
org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(Unm
arshallerImpl.java:211)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(Unma
rshallerImpl.java:184)
        at
javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmars
hallerImpl.java:137)
        at
javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmars
hallerImpl.java:184)
        at
org.apache.cxf.jaxrs.provider.JAXBElementProvider.unmarshalFromInputStre
am(JAXBElementProvider.java:193)
        at
org.apache.cxf.jaxrs.provider.JAXBElementProvider.doUnmarshal(JAXBElemen
tProvider.java:176)
        at
org.apache.cxf.jaxrs.provider.JAXBElementProvider.readFrom(JAXBElementPr
ovider.java:150)
        at
org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBody(JAXRSUtils.jav
a:861)
        at
org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:4
94)
        at
org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:
459)
        at
org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRS
InInterceptor.java:204)
        at
org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSI
nInterceptor.java:65)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorC
hain.java:236)
        at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiati
onObserver.java:104)
        at
org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestin
ation.java:99)
        at
org.apache.cxf.transport.servlet.ServletController.invokeDestination(Ser
vletController.java:452)
        at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletControl
ler.java:159)
        at
org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFSe
rvlet.java:220)
        at
org.apache.cxf.transport.servlet.AbstractCXFServlet.doPost(AbstractCXFSe
rvlet.java:153)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
        at
org.apache.cxf.transport.servlet.AbstractCXFServlet.service(AbstractCXFS
ervlet.java:211)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:290)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:206)
        at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilte
r.java:96)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:235)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:206)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:230)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:175)
        at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAs
sociationValve.java:179)
        at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.j
ava:84)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:127)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:102)
        at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConn
ectionValve.java:157)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:109)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:2
62)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:84
4)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
Http11Protocol.java:583)
        at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
        at java.lang.Thread.run(Thread.java:595)
19:12:15,583 ERROR [STDERR] Nov 17, 2009 7:12:15 PM
org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper toResponse
WARNING: WebApplicationException has been caught : unexpected element
(uri:"", local:"getOrderPaymentMethodRequest"). Ex pected elements are
<{}OrderRequest>
19:12:15,583 ERROR [STDERR] Nov 17, 2009 7:12:15 PM
org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onC
lose
INFO: Outbound Message
---------------------------
ID: 25
Encoding:
Content-Type: text/plain
Headers: {Content-Type=[text/plain], Date=[Wed, 18 Nov 2009 03:12:15
GMT]}
Payload: JAXBException occurred : unexpected element (uri:"",
local:"getOrderPaymentMethodRequest"). Expected elements a re
<{}OrderRequest>.
--------------------------------------

OrderRequest.java
------------------

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "orderRequest", propOrder = { "orderId" })
@XmlRootElement(name = "OrderRequest") public class OrderRequest {

@XmlElement(required = true)
protected Long orderId;

public Long getOrderId() {
return orderId;
}

public void setOrderId(Long value) {
this.orderId = value;
}

}

AuthHeader.java
---------------

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "authHeader", propOrder = { "userId" })
@XmlRootElement(name = "AuthHeader") public class AuthHeader {

    @XmlElement(name = "UserId", required = true) protected Long userId;

public Long getUserId() {
return userId;
}

public void setUserId(Long userId) {
this.userId = userId;
}

}

Regards
Karuna Pydipati
StubHub/eBay - Platform & Services
Phone: (415)222-8752
Email: [email protected]



Reply via email to