AW: [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
|

AW: [OFBiz] Users - SOAP service call

Javrishvili, Giorgi (Key-Work)
Thanks a lot!!!
I have an old version so I can't see available services.

I think I have taken exactly your examples from mailingList to make my ofbiz service wotk.

Are the definitions in service.xml correct? I mean, is this the correct way of doing?
I tried to make RPC call, because that service doesn't do anything outstanding(in the future I need message calls). But as I mentioned - it crashes.
May be there is something wrong with client that I wrote. Though with apache soap service it works. But in ofbiz there are no URN-s and service deployment descriptors...

My other question is how to write in ofbiz soap service that uses message. I found NO examples or docu... Is it exactly as "normal" soap message service(e.g. Apache Soap) or some other thing?

Once more thank you very much for your answer,

Giorgi

-----Ursprüngliche Nachricht-----
Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Peter Goron
Gesendet: Montag, 25. Juli 2005 18:28
An: OFBiz Users / Usage Discussion
Betreff: Re: [OFBiz] Users - SOAP service call


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
 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: AW: [OFBiz] Users - SOAP service call

Peter Goron
Hi,

> Thanks a lot!!!
> I have an old version so I can't see available services.
You can obtain WSDL of a service in java :
http://www.ofbiz.org/api/framework/service/build/javadocs/org/ofbiz/service/DispatchContext.html#getWSDL(java.lang.String,%20java.lang.String)

> I think I have taken exactly your examples from mailingList to make my ofbiz service wotk.
>
> Are the definitions in service.xml correct? I mean, is this the correct way of doing?
They seem correct except for soapHello that doesn't need to be declared
exportable and it's namespace should be http://www.ofbiz.org/service/

> I tried to make RPC call, because that service doesn't do anything outstanding(in the future I need message calls). But as I mentioned - it crashes.
> May be there is something wrong with client that I wrote. Though with apache soap service it works. But in ofbiz there are no URN-s and service deployment descriptors...
> My other question is how to write in ofbiz soap service that uses message. I found NO examples or docu... Is it exactly as "normal" soap message service(e.g. Apache Soap) or some other thing?

I'm not a soap expert so I don't understand what do you mean by message
calls but if it's to use service parameters, I can confirm it work.

The following python code calls the ofbiz testScv service via soap :

from SOAPpy import SOAPProxy

# create server proxy
url = 'http://localhost:8080/webtools/control/SOAPService'
namespace = 'http://www.ofbiz.org/service/'
server = SOAPProxy(url, namespace)

# show client/server exchange
server.config.dumpSOAPOut = 1
server.config.dumpSOAPIn = 1

# call service and display result
print "resp = " + server.testScv(message='hello world').resp


It produces on standard output :
*** Outgoing SOAP ******************************************************
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<ns1:testScv xmlns:ns1="http://www.ofbiz.org/service/"
SOAP-ENC:root="1">
<message xsi:type="xsd:string">hello world</message>
</ns1:testScv>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
************************************************************************
*** Incoming SOAP ******************************************************
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <ns1:testScvResponse xmlns:ns1="http://www.ofbiz.org/service/">
   <resp xsi:type="soapenc:string"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">service
done</resp>
   <responseMessage xsi:type="soapenc:string"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">success</responseMessage>
  </ns1:testScvResponse>
 </soapenv:Body>
</soapenv:Envelope>
************************************************************************
resp = service done

And you can see in ofbiz log :

5651167 (http-0.0.0.0-8080-Processor4) [     RequestHandler.java:208:INFO ] [Processing Request]: SOAPService
---- SVC-CONTEXT: locale => en_US
---- SVC-CONTEXT: message => hello world
-----SERVICE TEST----- : hello world
----- SVC: webtools -----
5652069 (http-0.0.0.0-8080-Processor4) [     ServiceEcaRule.java:113:INFO ] Got false for condition: [null][][message][equals][null][12345][true][String][]
5652070 (http-0.0.0.0-8080-Processor4) [  ServiceDispatcher.java:447:DEBUG] [[Sync service finished- total:0.0080,since last(Begin):0.0080]] - 'webtools / testScv'
5652116 (http-0.0.0.0-8080-Processor4) [     RequestManager.java:123:INFO ] [RequestManager.getRequestAttribute] Value for attribute "null" of uri "SOAPService" not found
5652135 (http-0.0.0.0-8080-Processor4) [     RequestHandler.java:357:INFO ] [RequestHandler.doRequest]: Response is handled by the event.
5652310 (http-0.0.0.0-8080-Processor4) [     ControlServlet.java:258:DEBUG] [[[SOAPService] Done rendering page, Servlet Finished- total:1.229,since last([SOAPService] Set...):1.229]]

Peter

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