NetBeans Web Services Client Issues Invalid Request For eBay API

I am trying to make my first web service client for eBay API using the New NetBeans Web Service Client wizard and WSDL found here . I understand this is using JAX-WS to generate class files and my requests are SOAP.

Everything seems to work fine, except when I try to make a request, eBay responds with a 404 which seems to be its standard response if the call doesn't make sense.

Wireshark shows my request as:

<?xml version="1.0" ?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<FindItemsRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<QueryKeywords>dvd players</QueryKeywords>
</FindItemsRequest></S:Body></S:Envelope>

      

But the eBay API testing tool says it should look like this:

<?xml version="1.0" encoding="utf-8"?>
<FindItems xmlns="urn:ebay:apis:eBLBaseComponents">
<QueryKeywords>dvd players</QueryKeywords>
</FindItems>

      

So NetBeans ended my request with what I can only assume is some standard SOAP structure and adds "Request" to the invocation name.

Where did he get that envelope space and why isn't eBay using it? And how can I tell NetBeans what I really want to do?

I am also wondering what is the use of the eBay SDK over this method (if it worked).

+1


source to share


1 answer


I managed to figure it out and, as usual, I kick myself for not fully reading the API docs.

The eBay API expects certain HTTP headers to be set before it gives anything other than 404.

After that, the NetBeans SOAP request that was generated was correctly interpreted by eBay and the expected results.



eBay shopping API HTTP header values

JAX-WS User Guide - Configuring HTTP Headers

0


source







All Articles