Hi All,
I am in need of some major help when it comes to web services…
Problem,
Our company produces a wsdl that contains employee data. I need to create a mechanism to consume that wsdl, create documents in my db and run and agent to update that data daily…
Anyone up for a challenge???
I can create a “Web Services Consumer” to ge the wsdl, I just have no clue from that point what to do with is…
What I am looking for…
Agent that grabs this consumer, creates documents from the returned data and have that agent run daily to update the data…
I appreciate anybody willing to lend me a hand…
Colin
Subject: an approach
Colin,
Starting from versions 8.x Lotus Offers additional features for developing with web services. But i have used, the traditional way of consuming web services (Lotus Script with Active X Objects)
I had a similar case where i needed to consume a web service offered by a third party. I had access to the WSDL file. I used “SOAPUI” tool to generate stubs/operations out of the WSDL file, thereby checking out the various methods/functions that i can use out of the web services. Then i constructed the SOAP message to be sent/posted to the target server(The SOAP request format for any method/function in a web service can be interpreted using SOAPUI tool) and got the response back, converted it to xml & parsed it to get the required details.
For posting the SOAP request to the target server i used Microsoft.XMLHttp active x object and to load & parse the response xml, i used MicrosoftXML2.DomDocument object.
Overall it’s very simple if we are developing in windows environment and a bit messy when it comes to unix/linux where have to use Java since Active X objects are not supported in unix/linux platform.
HTH,
Jason
Subject: Thanks for the info
Hi Jason,
Thank you for your input. I have managed to create an agent to consume the service I just can’t figure out what to do with it now. I have to do this via java and I am not a java programmer. Any suggestions on where I can get info to grab the values the wsdl returns and create notes docs from the return?
Subject: here’s a sample
Sorry, I haven’t been on the forum for a few days. I know from experience that the whole webservice thing can be quite tricky to figure out.
Step 1 - create your webservice consumer by importing the wsdl
here is a snipit of code
ws._queryRequest request;
request = new ws._queryRequest();
accesscare.AcWebServicePortType AcWs;
AcWs = new accesscare.AcWebServiceLocator().getAcWebServiceSOAP11port();
AcWs.setCredentials(JA_SystemValue.getSystemValue(db,"AccessCare UserId"),JA_SystemValue.getSystemValue(db,"AccessCare Password"));
// JA_SystemValue - just a lookup routine
//set the parameters
request.setApplication("APPName");
request.setBusinessUnit("BusName");
request.setIsp(spName);
request.setSpeedCode(doc.getItemValueString("RequestedSpeed"));
request.setParamType( "T");
request.setTnCkt(formatTN(doc.getItemValueString("CustPhoneNumber")));
request.setUser(getParmValue("User",formcontent));
//define the response
ws._queryResponse resp;
try {
//get the response
resp = AcWs.query(request);
//get status code
// i'm not really sure how to check for faults - i haven't found the class definition anywhere yet for either lotusscript or java
int stat = resp.getStatusCode();
if (stat == 0) { //successful
//get parameters from the response
ws._queryResult result = resp.getQueryResult();
…etc.