|
next
|
Subject: WS with SOAP - problem with parameter passing Author: Peter Denner Date: 24 Jan 2007 07:37 AM Originally Posted: 24 Jan 2007 07:35 AM
|
Hi - I am having a problem with passing the parameters in the right format in the soap enveolpe.
I have a web service (axix server) running and I can get the data with a axis client (java). Here is the code embedded in a jsp:
Import "java.util.HashMap"
import "java.util.List"
import "java.util.Map"
import "org.apache.axis.client.Call"
import "org.apache.axis.client.Service"
import "javax.xml.namespace.QName"
String endpoint ="http://localhost:8080/.../services/InquiryWebService";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new URL(endpoint) );
call.setOperationStyle("rpc");
call.setOperation("call");
call.setEncodingStyle("http://schemas.xmlsoap.org/soap/encoding/");
Object[] oParams = new Object[4];
String sUserName = "USER";
String sPassword = "PASSWORD";
String sInquiryName = "CollectiveNumberParts";
Map<String,String> mParams = new HashMap<String,String>();
oParams[0] = sUserName;
oParams[1] = sPassword;
oParams[2] = sInquiryName;
mParams.put("TYPE_PATTERN","OBJECTTYPE*");
mParams.put("PATTERN","OBJECTNUMBER*");
oParams[3] = mParams;
ret = call.invoke("call", oParams).toString();
When I try to get the data within Stylus, I don't know the right format for the SOAP envelope. Stylus returns only in0, in1, in2 and in3. The filling of the first three variables is easy.
Because the fourth variable is a HashMap in the axis java client, I don't know the right format for this in the SOAP-Envelope.
Here is what I have:
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<ns1:call xmlns:ns1="http://webServices.xxx.xxxxx.com">
<in0 xsi:type="xsd:string">USER</in0>
<in1 xsi:type="xsd:string">PASSWORD</in1>
<in2 xsi:type="xsd:string">CollectiveNumberParts</in2>
<in3>
??????
<item/>
</in3>
</ns1:call>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
The questionmarks are representing my "gap".
I've tried it with several strings like:
<in3 xsi:type="xsd:struct[2,2]">
<item xsi:type="xsd:string">TYPE_PATTERN</item>
<item xsi:type="xsd:string">OBJECTTYPE</item>
<item xsi:type="xsd:string">PATTERN</item>
<item xsi:type="xsd:string">OBJECTNUMBER*</item>
</in3>
but nothing works ...
Can you help me?
Thanks in advance
Peter
|
|
|