Hi all,
 
I am trying to consume public web services which require BASIC authentication. I get the wsdl file, use apache axis wsdl2java to get java classes. Then I used a java client to access the web service via the generated java classes.
It worked alright.
But because of some project requirements, I have to consume the web service using scripting language, namely Groovy.
So when I write the client in groovy, it gives 500 error, (Unknown host).
Does anyone have any clue?
 
The java code:
 
import com.sap.xi.FoundationLayer.*;
public class ProductListWS
{
  public static void main (String[] args) throws Exception{
  ProductList_WSDServiceLocator elmws = new ProductList_WSDServiceLocator();
  ProductList_WSDSoapBindingStub port =   (ProductList_WSDSoapBindingStub)elmws.getProductList_WSDSoapBinding();
 
 port._setProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY,"username");
 port._setProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY,"password");
 
 ProductSelection request = new ProductSelection("PS-110-30A");
 ProductPlantSelection request2 = new ProductPlantSelection("zzz");
 System.out.println(port.productListQueryResponse(request,request2));
}
}
 
 The groovy code (this one gives 500 error) :
 
import com.sap.xi.FoundationLayer.*;
 
ProductList_WSDServiceLocator elmws = new ProductList_WSDServiceLocator();
ProductList_WSDSoapBindingStub port = (ProductList_WSDSoapBindingStub)elmws.getProductList_WSDSoapBinding();
port._setProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY,"devchallenge");
port._setProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY,"web20");
ProductSelection request = new ProductSelection("PS-110-30A");
ProductPlantSelection request2 = new ProductPlantSelection("zzz");
println(port.productListQueryResponse(request,request2));
 
THE ERROR:
 
Caught: (500)Unknown Host
at ProductListWS.run(ProductListWS.groovy:15)
at ProductListWS.main(ProductListWS.groovy)
 
thnx a lot,
Hc

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Reply via email to