[OFBiz] Users - SOAP service call

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[OFBiz] Users - SOAP service call

Javrishvili, Giorgi (Key-Work)
Nachricht
Hi, guys!
 
I'm trying to make my, as I think correctly written soap service run, but it refuses to move...  So, may be some edvices from OFBiz gurus could change his mind.
 
So:
 
Here are my service definitions:
 
<service name="hello" default-entity-name="Product"
engine="java" location="de.kw.tech_tools.TechToolsServices"
invoke="hello" export="true">
<description>
Service for testing java services in Ofbiz
</description>
<attribute name="message" mode="OUT" type="String"
optional="false">
</attribute>
</service>
 
<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:
               String url = http://192.168.0.9:22080/webtools/control/SOAPService/soapHello;
               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?
3. String url = http://192.168.0.9:22080/webtools/control/SOAPService/soapHello; is that correct correct "location" for webServices in ofbiz?
4. When I'm accessing in browser http://192.168.0.9:22080/webtools/control/SOAPService  - It says Problem processing the service - It doesn't say that it could not find some page...
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
 

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: [OFBiz] Users - SOAP service call

Peter Goron
Hi,

We have succeeded to call an ofbiz webservice from a perl and a python
client.
The parameters were :
location=http://localhost:8080/webtools/control/SOAPService
namespace=http://www.ofbiz.org/service/

Ofbiz can produce the wsdl of an exportable service that contains all
informations required to call the webservice.
https://127.0.0.1:8443/webtools/control/availableServices?sel_service_name=testScv&show_wsdl=true

Peter

> Hi, guys!
>  
>  
> So, if anyone has understand this mess that I wrote, may be you have
> some ideas?
>  
> Many thanks,
>  
> Giorgi Javrishvili



 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users