http://ofbiz.116.s1.nabble.com/OFBiz-Users-SOAP-service-call-tp135214.html
<service name="soapHello" engine="soap"
export="true"
location="http://192.168.0.9:22080/webtools/control/SOAPService"
invoke="hello"
auth="false">
<description>
SOAP service; calls hello
service
</description>
<namespace>http://192.168.0.9:22080/</namespace>
<attribute name="message"
type="String" mode="OUT"
optional="false"
/>
</service>
Both are in
services.xml file of my project. No service_test.xml or something like that.
Hope this I did correctly.
Service itself
is very complex and complicated:
public static Map hello(DispatchContext ctx, Map context)
{
Map result = new
HashMap();
Debug.logInfo("Hello, this is our first SOAP service
in OFBiz", module);
result.put("message", "Hello, this is our
first SOAP service in OFBiz");
return
result;
}
So, while our PHP guys are fighting with php5 soap client, I want just to
be sure that services written by me are "callable" at
all.
And here am I stuck...
Some time ago I wrote some ApacheSoap service and called
simply with soapClient. But here it seems to be
different.
What
I do is following:
Call call = new Call(
);
//call.setTargetObjectURI("http://localhost:22080/");
//call.setMethodName("soapHello");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
// No parameters needed
// Invoke the
call
Response
response;
response = call.invoke(url, "");
It
throws:
[SOAPException:
faultCode=SOAP-ENV:Client; msg=Parsing error, response was:
Dokumentwurzelelement fehlt;
targetException=org.xml.sax.SAXParseException: Dokumentwurzelelement
fehlt]
at
org.apache.soap.rpc.Call.invoke(Call.java:298)
at
de.keywork.soap.CDLister.letOfbizSayHello(CDLister.java:75)
at
de.keywork.soap.CDLister.main(CDLister.java:105)
"Dokumentwurzelelement" means
Document root element
Actually it is a place in Call
class where it tries to read response.
I have a plenty of questions:
1. location=http://192.168.0.9:22080/webtools/control/SOAPService - is that a correct?
2. <namespace>http://192.168.0.9:22080/</namespace> - is that
correct?
5. May be ApacheSoap client is a wrong client at all?
In a "simple" version(With ApacheSoap) I had following:
call.setTargetObjectURI("urn:cd-catalog");
call.setMethodName("list");
and it was working without
problems...
Where
is a urn in OFBiz case? I mean if I understand correctly I don't need to write
any descriptors, isn't it? Everything seems to be done somehow by "itself". How?
I don't need to write any envelopes?
I don't what to
repeate issues, but I really couldn't find anything valuable... May be someone
could suggest good place to find the answers or could answer by
itself?
I'm digging
internet over and over again but with no success. My be I'm looking in wrong
places... Is there some documentation for that except service engine guide on the ofbiz
site?
So, if anyone
has understand this mess that I wrote, may be you have some
ideas?
Many
thanks,
Giorgi
Javrishvili