0 Replies Latest reply on Jan 8, 2011 10:49 AM by mafos

    SOAP exception with Ebay Finding API (Spring, JBoss AS 5.1.0) - need help

    mafos

      Hi there, I'm am trying to use Ebay webservice (Finding API) inside my simple Spring wepapp. Currently I am using the following code:

       

      {code}

      String strBaseURL = "http://svcs.ebay.com/services/search/FindingService/v1";

              FindingService service = new FindingService();

              FindingServicePortType port = service.getFindingServiceSOAPPort();

       

              BindingProvider bp = (BindingProvider) port;

              Map<String, Object> requestProperties = bp.getRequestContext();

       

              Map<String, List<String>> httpHeaders = new HashMap<String, List<String>>();

              httpHeaders.put("X-EBAY-SOA-MESSAGE-PROTOCOL", Collections.singletonList("SOAP12"));

              httpHeaders.put("X-EBAY-SOA-OPERATION-NAME", Collections.singletonList("findItemsAdvanced"));

              httpHeaders.put("X-EBAY-SOA-SECURITY-APPNAME", Collections.singletonList(ID));

              httpHeaders.put("X-EBAY-SOA-GLOBAL-ID", Collections.singletonList("EBAY-DE"));

       

              requestProperties.put(MessageContext.HTTP_REQUEST_HEADERS, httpHeaders);

              requestProperties.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,

                      strBaseURL);

       

              FindItemsAdvancedRequest req = new FindItemsAdvancedRequest();

              req.setSortOrder(SortOrderType.END_TIME_SOONEST);

              req.setKeywords("3dfx");

       

              FindItemsAdvancedResponse res = port.findItemsAdvanced(req);

      {code}

       

      This works when run as a standalone Java app. But inside a Spring view controller deployed into JBoss AS 5.1.0 (default profile), I get this:

       

      {code}

      javax.xml.ws.soap.SOAPFaultException: Missing SOA operation name header

      org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS.getSOAPFaultException(SOAPFaultHelperJAXWS.java:84)

      org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS.throwFaultException(SOAP11BindingJAXWS.java:107)

      org.jboss.ws.core.CommonSOAPBinding.unbindResponseMessage(CommonSOAPBinding.java:579)

      org.jboss.ws.core.CommonClient.invoke(CommonClient.java:381)

      org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:290)

      org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:170)

      org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:150)

      $Proxy287.findItemsAdvanced(Unknown Source)

      maf.board.web.EbayController.handleRequestInternal(EbayController.java:56)

      [...]

      {code}

       

      I guess the problem is with the jax-ws implementation (right?), because when cause the exception inside the standalone code myself, I get this:

       

      {code}

      Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Missing SOA operation name header

          at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)

          at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:119)

          at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)

          at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)

          at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)

          at $Proxy35.findItemsAdvanced(Unknown Source)

          at Test.main(Test.java:45)

      {code}

       

      I am quiet new to JBoss, WS, SOAP etc. so I don't really what to do with this problem. Any help will be appreciated.

      If I missed the forum category, feel free to move it.