View Full Version : Has anybody got this working from Java?
geoffballinger
29-11-07, 13:05
The more I look into this the more I get the feeling that I am onto a looser trying to do this in Java and that it would probably be quicker to go and buy a book on PHP (:eek:) and build a little XMLRPC service in PHP wrapping the AW client provided.
Has anybody else managed to make this work from java and if so any particular tips on how to best approach it.
Thanks!,
Geoff.
Not tried Geoff, and wouldn't have a clue where to start - sorry.
I think most here are just modifying the client, a few are writing PHP from scratch and even fewer are using .NET. Haven't heard from anyone using Java I'm afraid.
It would be good to do a poll on this - started one here (http://www.shopwindowforum.com/showthread.php?t=431)
Everything i'm doing for my version of ShopWindow is via the ready made php scripts. I wouldn't have bothered if i'd had to design my own using javascript, as it would take longer to achieve than it is worth for the results, considering the shopwindow client has everything needed to open a shop and is pretty easily customisable.
geoffballinger
30-11-07, 15:38
Getting a little warmer now - have managed to make Axis make what appears to be a reasonable request but unfortunately the SW server is responding w/ and HTTP 500.
The request as logged by Axis is (auth details X'd out) ...
POST /v1/ProductServeService HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.4
Host: api.productserve.com
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: ""
Content-Length: 1447
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Header><ns1:UserAuthentication soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="http://api.productserve.com/"><ns1:iId>XXXXX</ns1:iId><ns1:sPassword>XXXXXXX</ns1:sPassword><ns1:sType>affiliate</ns1:sType></ns1:UserAuthentication><ns2:sQuery xmlns:ns2="http://api.productserve.com/">yellow tights</ns2:sQuery><ns3:sMode xmlns:ns3="http://api.productserve.com/">any</ns3:sMode><ns4:sSort xmlns:ns4="http://api.productserve.com/">relevance</ns4:sSort><ns5:iCategoryId xmlns:ns5="http://api.productserve.com/">97</ns5:iCategoryId><ns6:aMerchantIds xmlns:ns6="http://api.productserve.com/"/><ns7:iOffset xmlns:ns7="http://api.productserve.com/">0</ns7:iOffset><ns8:iLimit xmlns:ns8="http://api.productserve.com/">5</ns8:iLimit><ns9:bIncludeDescendants xmlns:ns9="http://api.productserve.com/">true</ns9:bIncludeDescendants><ns10:bSafeFilter xmlns:ns10="http://api.productserve.com/">false</ns10:bSafeFilter><ns11:fMinPrice xmlns:ns11="http://api.productserve.com/">0.0</ns11:fMinPrice><ns12:fMaxPrice xmlns:ns12="http://api.productserve.com/">50.0</ns12:fMaxPrice></soapenv:Header><soapenv:Body><searchProduct xmlns="http://api.productserve.com/"/></soapenv:Body></soapenv:Envelope>
Any observations as to what is wrong with this and in particular why I get a 500 rather than any sort of well formed error response would be useful - thanks!,
Geoff.
geoffballinger
30-11-07, 15:59
Getting a little warmer now - have managed to make Axis make what appears to be a reasonable request but unfortunately the SW server is responding w/ and HTTP 500.
Guess the fact that all the fields have ended up in the header rather than the body might have something to do with it! :(
G.
Geoff,
Did you look at the stuff I noticed? I'm able to create the service and even make the call but I'm always getting quota exceeded problems. It's not clear whether UserAuthentication is working as it seems I can put anything in there and get quota issues. I'm loading the WSDL locally which is allowing me to create the service. I've noticed numerous differences between the WSDL and the API document which doesn't help matters.
geoffballinger
06-12-07, 14:10
Still struggling here - looks like the params being in as headers isn't the issue. Managed to fix that by hacking the Axis generated ApiBindingStub class but still the same issue - get an HTTP 500 back - assume that shouldn't happen?
For info most recent attempt was (w/ auth X'd out) ...
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header><ns1:UserAuthentication soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="http://api.productserve.com/"><ns1:iId>XXXXX</ns1:iId><ns1:sPassword>XXXXXX</ns1:sPassword><ns1:sType>affiliate</ns1:sType></ns1:UserAuthentication></soapenv:Header>
<soapenv:Body><searchProduct xmlns="http://api.productserve.com/"><sQuery>yellow tights</sQuery><sMode>any</sMode><sSort>relevance</sSort><iCategoryId>97</iCategoryId><aMerchantIds/><iOffset>0</iOffset><iLimit>5</iLimit><bIncludeDescendants>true</bIncludeDescendants><bSafeFilter>false</bSafeFilter><fMinPrice>0.0</fMinPrice><fMaxPrice>50.0</fMaxPrice></searchProduct></soapenv:Body>
</soapenv:Envelope>
Response is a 500 - no XML in body. Can anybody suggest anything obviously wrong with this? Thanks!,
Geoff.
Hi Geoff - would you like to see my code and maybe you can see what I have done. I don't know if what I have is close to what you're doing but it might give you a different perspective and help us both move on.