AW: 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: AW: [OFBiz] Users - SOAP service call

Javrishvili, Giorgi (Key-Work)
Hi, Peter.

Many thanks for your answers. They are extremely useful, believe me!
So, with outgoing soap is now OK.
I finally found the problem. I mean, I see now at least following:

If I call my service, I mean, "soapHello", I get

************************************************************************
*** Incoming SOAP ******************************************************
Requested service not available
************************************************************************

But if I call some "soapHelloGoodByeDontComeBack"(which doesn't exist at all) I'm getting

************************************************************************
*** Incoming SOAP ******************************************************
Problem processing the service
************************************************************************

Here is a services.xml part:

<service name="hello" default-entity-name="Product"
                engine="java" location="de.kw.tech_tools.TechToolServices"
                invoke="hello" export="true">
                <description>
                        Service for testing java services in Ofbiz
                </description>
                <attribute name="userName" type="String" mode="IN"
                        optional="true">
                </attribute>
                <attribute name="message" type="String" mode="OUT"
                        optional="true">
                </attribute>
        </service>

<service name="soapHello" engine="soap"
                location="http://localhost:22080/webtools/control/SOAPService"
                invoke="hello" auth="false" export="false">
                <description>
                        SOAP service;
                </description>
                <!-- <namespace>http://localhost:22080/</namespace>-->
                <namespace>http://www.ofbiz.org/service/</namespace>
                <attribute name="userName" type="String" mode="IN"
                        optional="true">
                </attribute>
                <attribute name="message" type="String" mode="OUT"
                        optional="true">
                </attribute>
        </service>

What is important, that "hello" service itself is called without problems by dispatcher.runSync("hello"...).

Does it need any additional configuration?

Thank you in advance,

Giorgi


-----Ursprüngliche Nachricht-----
Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Peter Goron
Gesendet: Dienstag, 26. Juli 2005 14:20
An: OFBiz Users / Usage Discussion
Betreff: Re: AW: [OFBiz] Users - SOAP service call


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

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

Peter Goron
Hi Giorgi,

Your service definitions seem to be correct but I've never tried to call
a webservice from ofbiz.

Does the ofbiz log file contain some errors or warnings ?

You can also try to a call an external webservice from ofbiz (e.g.
google) to check if the problem comes from the client or server part of
ofbiz soap implementation.


Peter

> Hi, Peter.
>
> Many thanks for your answers. They are extremely useful, believe me!
> So, with outgoing soap is now OK.
> I finally found the problem. I mean, I see now at least following:
>
> If I call my service, I mean, "soapHello", I get
>
> ************************************************************************
> *** Incoming SOAP ******************************************************
> Requested service not available
> ************************************************************************
>
> But if I call some "soapHelloGoodByeDontComeBack"(which doesn't exist at all) I'm getting
>
> ************************************************************************
> *** Incoming SOAP ******************************************************
> Problem processing the service
> ************************************************************************
>
> Here is a services.xml part:
>
> <service name="hello" default-entity-name="Product"
> engine="java" location="de.kw.tech_tools.TechToolServices"
> invoke="hello" export="true">
> <description>
> Service for testing java services in Ofbiz
> </description>
> <attribute name="userName" type="String" mode="IN"
> optional="true">
> </attribute>
> <attribute name="message" type="String" mode="OUT"
> optional="true">
> </attribute>
> </service>
>
> <service name="soapHello" engine="soap"
> location="http://localhost:22080/webtools/control/SOAPService"
> invoke="hello" auth="false" export="false">
> <description>
> SOAP service;
> </description>
> <!-- <namespace>http://localhost:22080/</namespace>-->
> <namespace>http://www.ofbiz.org/service/</namespace>
> <attribute name="userName" type="String" mode="IN"
> optional="true">
> </attribute>
> <attribute name="message" type="String" mode="OUT"
> optional="true">
> </attribute>
> </service>
>
> What is important, that "hello" service itself is called without problems by dispatcher.runSync("hello"...).
>
> Does it need any additional configuration?
>
> Thank you in advance,
>
> Giorgi
>
>


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