Not able to invoke document style service from DII Client

I am not able to invoke document/literal service from DII client. It works fine for rpc/encoded service.

Here is the code:

System.setProperty("javax.xml.rpc.ServiceFactory",

"weblogic.webservice.core.rpc.ServiceFactoryImpl");

ServiceFactory sf = ServiceFactory.newInstance();

QName serviceQname = new QName("http://batchrecord.webservices.sums.cfm.com", "CFMBatchRecordService");

Service service = sf.createService( serviceQname);

QName portQname = new QName("http://batchrecord.webservices.sums.cfm.com", "CFMBatchRecordServicePort");

QName QNAME_TYPE_STRING = new QName(NS_XSD, "string");

Call call = service.createCall(portQname);

// call.setProperty("javax.xml.rpc.encodingstyle.namespace.uri", "");

call.setProperty(Call.OPERATION_STYLE_PROPERTY, "document");

call.setTargetEndpointAddress(endpoint);

call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));

call.setProperty(Call.SOAPACTION_URI_PROPERTY, "");

call.setReturnType(QNAME_TYPE_STRING);

call.setOperationName(new QName("http://batchrecord.webservices.sums.cfm.com", "processBREditForAlerts"));

call.addParameter("string", QNAME_TYPE_STRING, ParameterMode.IN);

// call.addParameter("parameters", requestQname, String.class, ParameterMode.IN);

String params[] = {

"testtest"};

String result = (String) call.invoke(new QName("http://batchrecord.webservices.sums.cfm.com"), params);

System.out.println(result);

[1524 byte] By [AshutoshKa] at [2007-10-2 10:57:00]
# 1
What happens when you uncomment this line: // call.setProperty("javax.xml.rpc.encodingstyle.namespace.uri", "");Also, what version are you running because some didn't support DII with doc/literal?
swatdbaa at 2007-7-13 3:23:02 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

Uncommenting that line gives following error

java.lang.IllegalArgumentException: Unable to find type mapping for encodingStyle . In registry weblogic.webservice.core.encoding.DefaultRegistry[ registerd encodingStyle = http://schemas.xmlsoap.org/soap/encoding/,http://www.w3.org/2003/05/soap-encoding,]

AshutoshKa at 2007-7-13 3:23:02 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3

hi AshutoshK ,

I am trying to call the webservice from a java client using DII. I deployed the webservice in weblogic. My problem is that i am not able to do it either by document or rpc. I am getting NullPointerException when i call the service and hence getting a null value as the response. I dont know what exactly is the problem but i guess its related to the namespaces.

So can u please give me the code you have written to call the webservice from java client using DII.

Thanks in advance

sankalpa at 2007-7-13 3:23:02 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4

DII was never designed to work well with document/literal web services. If you want to do this, I suggest you try JAX-WS's Dispatch interface which was designed specifilcally for document/literal invocations.You can read about JAX-WS at http://jax-ws.dev.java.net. There are samples that show you how to use Dispatch, as well as the server side equivalent (Provider). JAX-WS is part of JWSDP 2.0 which can be downloaded at: http://java.sun.com/webservices/downloads/webservicespack.html

dkohlerta at 2007-7-13 3:23:02 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 5

Do you mean DII can not be used to invoke document/literal service?I got several examples on net. But none of them work. SOAP fault says

"Unable to find a matching Operation for this remote invocation

Please check your operation name"

out going soap message is

POST /sumswebservices/CFMBatchRecordService HTTP/1.1

Content-Type: text/xml

SOAPAction: ""

User-Agent: Java/1.4.2_05

Host: 127.0.0.1

Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2

Connection: keep-alive

Content-Length: 339

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<env:Body>

<xsd:string xmlns:xsd="http://www.w3.org/2001/XMLSchema">testtest</xsd:string>

</env:Body></env:Envelope>

AshutoshKa at 2007-7-13 3:23:02 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 6
DII does work with basic doc/lit invocations, but once you start dealing with more complex structures, problems may occur.
dkohlerta at 2007-7-13 3:23:02 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...