send events from ofbiz

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

send events from ofbiz

Milan Agatonovic
Hello,
I am working with a large instance of OFBIZ and trying to find the best way
to send events outside: http, message queue (whatever).
The examples of the events are:
- new order, product catalog update, etc

The idea that is very close to what I need is
https://github.com/bibryam/ofbiz-camel
but I'd like to hear what others think and whether there is better, more
"ofbizy" way to do this?

Thank you,
Milan
Reply | Threaded
Open this post in threaded view
|

Re: send events from ofbiz

Michael Brohl-3
Hi Milan,

I think it mostly depends on the capabilities of the systems you want to
connect to.

You can use REST services with data represented in JSON if the external
system supports it.

If you want to use Java messaging, please refer to
http://ofbiz.135035.n4.nabble.com/Setting-Ofbiz-with-Enterprise-Service-Bus-td4662296.html 
where I have tried to describe how it can be implemented.

Bilgin's Camel endpoint for OFBiz is another option if you are using
camel in your environment.

Best regards,

Michael Brohl
ecomify GmbH
www.ecomify.de


Am 20.02.17 um 09:33 schrieb Milan Agatonovic:

> Hello,
> I am working with a large instance of OFBIZ and trying to find the best way
> to send events outside: http, message queue (whatever).
> The examples of the events are:
> - new order, product catalog update, etc
>
> The idea that is very close to what I need is
> https://github.com/bibryam/ofbiz-camel
> but I'd like to hear what others think and whether there is better, more
> "ofbizy" way to do this?
>
> Thank you,
> Milan
>


smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: send events from ofbiz

Vogelsme
In reply to this post by Milan Agatonovic
That is actually exactly what we do in our larger environments.
Outgoing requests are all routed via ActiveMQ/Camel.
For incoming SOAP requests we use the ofbiz-mechanism; for REST we use apache wink (that we have integrated into OFBiz as a hot-deploy module).

Reply | Threaded
Open this post in threaded view
|

Re: send events from ofbiz

Milan Agatonovic
Thank you, the external system (event receiver) can support anything,
simply because it still doesn't exist :)
I am looking for the easiest, least to code at ofbiz end, preferably
"enable by configuration" way where the "aggregated view / event" will be
sent out.
Any example out there?



On Mon, Feb 20, 2017 at 9:51 AM, Vogelsme <[hidden email]> wrote:

> That is actually exactly what we do in our larger environments.
> Outgoing requests are all routed via ActiveMQ/Camel.
> For incoming SOAP requests we use the ofbiz-mechanism; for REST we use
> apache wink (that we have integrated into OFBiz as a hot-deploy module).
>
>
>
>
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.
> com/send-events-from-ofbiz-tp4702636p4702639.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: send events from ofbiz

Michael Brohl-3
Do you want to actively send out events to another system or will the
external system request information from your OFBiz instance?

Michael

Am 20.02.17 um 10:01 schrieb Milan Agatonovic:

> Thank you, the external system (event receiver) can support anything,
> simply because it still doesn't exist :)
> I am looking for the easiest, least to code at ofbiz end, preferably
> "enable by configuration" way where the "aggregated view / event" will be
> sent out.
> Any example out there?
>
>
>
> On Mon, Feb 20, 2017 at 9:51 AM, Vogelsme <[hidden email]> wrote:
>
>> That is actually exactly what we do in our larger environments.
>> Outgoing requests are all routed via ActiveMQ/Camel.
>> For incoming SOAP requests we use the ofbiz-mechanism; for REST we use
>> apache wink (that we have integrated into OFBiz as a hot-deploy module).
>>
>>
>>
>>
>>
>> --
>> View this message in context: http://ofbiz.135035.n4.nabble.
>> com/send-events-from-ofbiz-tp4702636p4702639.html
>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>


smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: send events from ofbiz

Milan Agatonovic
- send out events to the external system (ideally with some control /
configuration which data to send out, but I can live with defaults).

On Mon, Feb 20, 2017 at 10:21 AM, Michael Brohl <[hidden email]>
wrote:

> Do you want to actively send out events to another system or will the
> external system request information from your OFBiz instance?
>
> Michael
>
> Am 20.02.17 um 10:01 schrieb Milan Agatonovic:
>
> Thank you, the external system (event receiver) can support anything,
>> simply because it still doesn't exist :)
>> I am looking for the easiest, least to code at ofbiz end, preferably
>> "enable by configuration" way where the "aggregated view / event" will be
>> sent out.
>> Any example out there?
>>
>>
>>
>> On Mon, Feb 20, 2017 at 9:51 AM, Vogelsme <[hidden email]>
>> wrote:
>>
>> That is actually exactly what we do in our larger environments.
>>> Outgoing requests are all routed via ActiveMQ/Camel.
>>> For incoming SOAP requests we use the ofbiz-mechanism; for REST we use
>>> apache wink (that we have integrated into OFBiz as a hot-deploy module).
>>>
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context: http://ofbiz.135035.n4.nabble.
>>> com/send-events-from-ofbiz-tp4702636p4702639.html
>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>
>>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: send events from ofbiz

Pierre Smits
In reply to this post by Vogelsme
Hi Mirko,

It is nice to read that you have successfully integrated Apache Wink into
OFBiz. Did you base that integration on [1]?
Would you be willing to review that page and (if necessary) improve?


[1]
https://cwiki.apache.org/confluence/display/OFBIZ/Export+service+using+REST

Best regards,

Pierre Smits

ORRTIZ.COM <http://www.orrtiz.com>
OFBiz based solutions & services

OFBiz Extensions Marketplace
http://oem.ofbizci.net/oci-2/

On Mon, Feb 20, 2017 at 9:51 AM, Vogelsme <[hidden email]> wrote:

> That is actually exactly what we do in our larger environments.
> Outgoing requests are all routed via ActiveMQ/Camel.
> For incoming SOAP requests we use the ofbiz-mechanism; for REST we use
> apache wink (that we have integrated into OFBiz as a hot-deploy module).
>
>
>
>
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.
> com/send-events-from-ofbiz-tp4702636p4702639.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: send events from ofbiz

Milan Agatonovic
Thanks for the nice interpellation Pierre,
but is there anybody who can share the experience of sending events out the
ofbiz?

cheers,
Milan

On Mon, Feb 20, 2017 at 11:02 AM, Pierre Smits <[hidden email]>
wrote:

> Hi Mirko,
>
> It is nice to read that you have successfully integrated Apache Wink into
> OFBiz. Did you base that integration on [1]?
> Would you be willing to review that page and (if necessary) improve?
>
>
> [1]
> https://cwiki.apache.org/confluence/display/OFBIZ/
> Export+service+using+REST
>
> Best regards,
>
> Pierre Smits
>
> ORRTIZ.COM <http://www.orrtiz.com>
> OFBiz based solutions & services
>
> OFBiz Extensions Marketplace
> http://oem.ofbizci.net/oci-2/
>
> On Mon, Feb 20, 2017 at 9:51 AM, Vogelsme <[hidden email]>
> wrote:
>
> > That is actually exactly what we do in our larger environments.
> > Outgoing requests are all routed via ActiveMQ/Camel.
> > For incoming SOAP requests we use the ofbiz-mechanism; for REST we use
> > apache wink (that we have integrated into OFBiz as a hot-deploy module).
> >
> >
> >
> >
> >
> > --
> > View this message in context: http://ofbiz.135035.n4.nabble.
> > com/send-events-from-ofbiz-tp4702636p4702639.html
> > Sent from the OFBiz - User mailing list archive at Nabble.com.
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: send events from ofbiz

Vogelsme
@Pierre
Thats pretty much what we did. Will check out that page later.

@Milan
As I do not know what exactly your plan it is hard to help you.
The OFBiz-Way would be to use the Serviceengine to connect to anything outside like an JMX Broker.
You can define your own engine in the serviceengine.xml like '<engine name="jms" class="org.ofbiz.service.jms.JmsServiceEngine"/>'
and define the service like (common/services_test.xml)
<service name="testJMSQueue" engine="jms" location="serviceMessenger" invoke="testScv">...

Distributed Cache Clear uses the same mechanism:
https://cwiki.apache.org/confluence/display/OFBIZ/Distributed+Entity+Cache+Clear+(DCC)+Mechanism
Reply | Threaded
Open this post in threaded view
|

Re: send events from ofbiz

Milan Agatonovic
Thanks Mirko,
apart from JMS and JNDI-ed Broker, is there any other "out-of-the-box" way
that you are aware of?

On Tue, Feb 21, 2017 at 11:59 AM, Vogelsme <[hidden email]>
wrote:

> @Pierre
> Thats pretty much what we did. Will check out that page later.
>
> @Milan
> As I do not know what exactly your plan it is hard to help you.
> The OFBiz-Way would be to use the Serviceengine to connect to anything
> outside like an JMX Broker.
> You can define your own engine in the serviceengine.xml like '<engine
> name="jms" class="org.ofbiz.service.jms.JmsServiceEngine"/>'
> and define the service like (common/services_test.xml)
> <service name="testJMSQueue" engine="jms" location="serviceMessenger"
> invoke="testScv">...
>
> Distributed Cache Clear uses the same mechanism:
> https://cwiki.apache.org/confluence/display/OFBIZ/
> Distributed+Entity+Cache+Clear+(DCC)+Mechanism
>
>
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.
> com/send-events-from-ofbiz-tp4702636p4702683.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: send events from ofbiz

Jacques Le Roux
Administrator
Hi Milan,

You can also directly use SOAP, though there is a small limitation. The external client must use a slightly changed Apache CXF

See https://issues.apache.org/jira/browse/OFBIZ-4245 for details

HTH

Jacques


Le 21/02/2017 à 12:15, Milan Agatonovic a écrit :

> Thanks Mirko,
> apart from JMS and JNDI-ed Broker, is there any other "out-of-the-box" way
> that you are aware of?
>
> On Tue, Feb 21, 2017 at 11:59 AM, Vogelsme <[hidden email]>
> wrote:
>
>> @Pierre
>> Thats pretty much what we did. Will check out that page later.
>>
>> @Milan
>> As I do not know what exactly your plan it is hard to help you.
>> The OFBiz-Way would be to use the Serviceengine to connect to anything
>> outside like an JMX Broker.
>> You can define your own engine in the serviceengine.xml like '<engine
>> name="jms" class="org.ofbiz.service.jms.JmsServiceEngine"/>'
>> and define the service like (common/services_test.xml)
>> <service name="testJMSQueue" engine="jms" location="serviceMessenger"
>> invoke="testScv">...
>>
>> Distributed Cache Clear uses the same mechanism:
>> https://cwiki.apache.org/confluence/display/OFBIZ/
>> Distributed+Entity+Cache+Clear+(DCC)+Mechanism
>>
>>
>>
>> --
>> View this message in context: http://ofbiz.135035.n4.nabble.
>> com/send-events-from-ofbiz-tp4702636p4702683.html
>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>

Reply | Threaded
Open this post in threaded view
|

Re: send events from ofbiz

Milan Agatonovic
Thanks but I am looking to more contemporary way, since the app that should
expose the API to ofbiz is yet to be built by 3rd party and will not
support SOAP, only REST.
Any published attempts to send event to kafka, rabbit or some message other
queue?

On Tue, Feb 21, 2017 at 4:00 PM, Jacques Le Roux <
[hidden email]> wrote:

> Hi Milan,
>
> You can also directly use SOAP, though there is a small limitation. The
> external client must use a slightly changed Apache CXF
>
> See https://issues.apache.org/jira/browse/OFBIZ-4245 for details
>
> HTH
>
> Jacques
>
>
>
> Le 21/02/2017 à 12:15, Milan Agatonovic a écrit :
>
>> Thanks Mirko,
>> apart from JMS and JNDI-ed Broker, is there any other "out-of-the-box" way
>> that you are aware of?
>>
>> On Tue, Feb 21, 2017 at 11:59 AM, Vogelsme <[hidden email]>
>> wrote:
>>
>> @Pierre
>>> Thats pretty much what we did. Will check out that page later.
>>>
>>> @Milan
>>> As I do not know what exactly your plan it is hard to help you.
>>> The OFBiz-Way would be to use the Serviceengine to connect to anything
>>> outside like an JMX Broker.
>>> You can define your own engine in the serviceengine.xml like '<engine
>>> name="jms" class="org.ofbiz.service.jms.JmsServiceEngine"/>'
>>> and define the service like (common/services_test.xml)
>>> <service name="testJMSQueue" engine="jms" location="serviceMessenger"
>>> invoke="testScv">...
>>>
>>> Distributed Cache Clear uses the same mechanism:
>>> https://cwiki.apache.org/confluence/display/OFBIZ/
>>> Distributed+Entity+Cache+Clear+(DCC)+Mechanism
>>>
>>>
>>>
>>> --
>>> View this message in context: http://ofbiz.135035.n4.nabble.
>>> com/send-events-from-ofbiz-tp4702636p4702683.html
>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>
>>>
>
Reply | Threaded
Open this post in threaded view
|

Re: send events from ofbiz

Jacques Le Roux
Administrator
I guess Kafka as ServiceMix and most others are using AMQ underneath. Rabbit is another beast, your choice...

Jacques


Le 21/02/2017 à 16:16, Milan Agatonovic a écrit :

> Thanks but I am looking to more contemporary way, since the app that should
> expose the API to ofbiz is yet to be built by 3rd party and will not
> support SOAP, only REST.
> Any published attempts to send event to kafka, rabbit or some message other
> queue?
>
> On Tue, Feb 21, 2017 at 4:00 PM, Jacques Le Roux <
> [hidden email]> wrote:
>
>> Hi Milan,
>>
>> You can also directly use SOAP, though there is a small limitation. The
>> external client must use a slightly changed Apache CXF
>>
>> See https://issues.apache.org/jira/browse/OFBIZ-4245 for details
>>
>> HTH
>>
>> Jacques
>>
>>
>>
>> Le 21/02/2017 à 12:15, Milan Agatonovic a écrit :
>>
>>> Thanks Mirko,
>>> apart from JMS and JNDI-ed Broker, is there any other "out-of-the-box" way
>>> that you are aware of?
>>>
>>> On Tue, Feb 21, 2017 at 11:59 AM, Vogelsme <[hidden email]>
>>> wrote:
>>>
>>> @Pierre
>>>> Thats pretty much what we did. Will check out that page later.
>>>>
>>>> @Milan
>>>> As I do not know what exactly your plan it is hard to help you.
>>>> The OFBiz-Way would be to use the Serviceengine to connect to anything
>>>> outside like an JMX Broker.
>>>> You can define your own engine in the serviceengine.xml like '<engine
>>>> name="jms" class="org.ofbiz.service.jms.JmsServiceEngine"/>'
>>>> and define the service like (common/services_test.xml)
>>>> <service name="testJMSQueue" engine="jms" location="serviceMessenger"
>>>> invoke="testScv">...
>>>>
>>>> Distributed Cache Clear uses the same mechanism:
>>>> https://cwiki.apache.org/confluence/display/OFBIZ/
>>>> Distributed+Entity+Cache+Clear+(DCC)+Mechanism
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context: http://ofbiz.135035.n4.nabble.
>>>> com/send-events-from-ofbiz-tp4702636p4702683.html
>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>>
>>>>

Reply | Threaded
Open this post in threaded view
|

Re: send events from ofbiz

Scott Gray-3
In reply to this post by Milan Agatonovic
Hi Milan,

You may want to consider implementing your own service engine
implementation, there really isn't much to it and from there you can send
the events however you like to wherever you like.  Take a look at the
HttpEngine as an example.  Once you've defined an engine you then need to
define a service that will use it (or multiple services) and then you can
call that service either inline as the triggering event occurs or via SECAs
or EECAs.

In terms of existing engines you could re-use:
- HttpEngine - sends a POST to the URL defined in the service and expects
an OFBiz-specific XML serialized document in return (intended for
communication between OFBiz instances I believe)
- SOAP
- XML-RPC
- JMS

But you're still going to have to do the work of wiring up the notifying
service(s) to the underlying event in the system, there's no tool that
avoids that task.

Regards
Scott

On 22 February 2017 at 04:16, Milan Agatonovic <[hidden email]>
wrote:

> Thanks but I am looking to more contemporary way, since the app that should
> expose the API to ofbiz is yet to be built by 3rd party and will not
> support SOAP, only REST.
> Any published attempts to send event to kafka, rabbit or some message other
> queue?
>
> On Tue, Feb 21, 2017 at 4:00 PM, Jacques Le Roux <
> [hidden email]> wrote:
>
> > Hi Milan,
> >
> > You can also directly use SOAP, though there is a small limitation. The
> > external client must use a slightly changed Apache CXF
> >
> > See https://issues.apache.org/jira/browse/OFBIZ-4245 for details
> >
> > HTH
> >
> > Jacques
> >
> >
> >
> > Le 21/02/2017 à 12:15, Milan Agatonovic a écrit :
> >
> >> Thanks Mirko,
> >> apart from JMS and JNDI-ed Broker, is there any other "out-of-the-box"
> way
> >> that you are aware of?
> >>
> >> On Tue, Feb 21, 2017 at 11:59 AM, Vogelsme <[hidden email]>
> >> wrote:
> >>
> >> @Pierre
> >>> Thats pretty much what we did. Will check out that page later.
> >>>
> >>> @Milan
> >>> As I do not know what exactly your plan it is hard to help you.
> >>> The OFBiz-Way would be to use the Serviceengine to connect to anything
> >>> outside like an JMX Broker.
> >>> You can define your own engine in the serviceengine.xml like '<engine
> >>> name="jms" class="org.ofbiz.service.jms.JmsServiceEngine"/>'
> >>> and define the service like (common/services_test.xml)
> >>> <service name="testJMSQueue" engine="jms" location="serviceMessenger"
> >>> invoke="testScv">...
> >>>
> >>> Distributed Cache Clear uses the same mechanism:
> >>> https://cwiki.apache.org/confluence/display/OFBIZ/
> >>> Distributed+Entity+Cache+Clear+(DCC)+Mechanism
> >>>
> >>>
> >>>
> >>> --
> >>> View this message in context: http://ofbiz.135035.n4.nabble.
> >>> com/send-events-from-ofbiz-tp4702636p4702683.html
> >>> Sent from the OFBiz - User mailing list archive at Nabble.com.
> >>>
> >>>
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: send events from ofbiz

Milan Agatonovic
Thank you Scott

On Wed, Feb 22, 2017 at 5:51 AM, Scott Gray <[hidden email]>
wrote:

> Hi Milan,
>
> You may want to consider implementing your own service engine
> implementation, there really isn't much to it and from there you can send
> the events however you like to wherever you like.  Take a look at the
> HttpEngine as an example.  Once you've defined an engine you then need to
> define a service that will use it (or multiple services) and then you can
> call that service either inline as the triggering event occurs or via SECAs
> or EECAs.
>
> In terms of existing engines you could re-use:
> - HttpEngine - sends a POST to the URL defined in the service and expects
> an OFBiz-specific XML serialized document in return (intended for
> communication between OFBiz instances I believe)
> - SOAP
> - XML-RPC
> - JMS
>
> But you're still going to have to do the work of wiring up the notifying
> service(s) to the underlying event in the system, there's no tool that
> avoids that task.
>
> Regards
> Scott
>
> On 22 February 2017 at 04:16, Milan Agatonovic <[hidden email]
> >
> wrote:
>
> > Thanks but I am looking to more contemporary way, since the app that
> should
> > expose the API to ofbiz is yet to be built by 3rd party and will not
> > support SOAP, only REST.
> > Any published attempts to send event to kafka, rabbit or some message
> other
> > queue?
> >
> > On Tue, Feb 21, 2017 at 4:00 PM, Jacques Le Roux <
> > [hidden email]> wrote:
> >
> > > Hi Milan,
> > >
> > > You can also directly use SOAP, though there is a small limitation. The
> > > external client must use a slightly changed Apache CXF
> > >
> > > See https://issues.apache.org/jira/browse/OFBIZ-4245 for details
> > >
> > > HTH
> > >
> > > Jacques
> > >
> > >
> > >
> > > Le 21/02/2017 à 12:15, Milan Agatonovic a écrit :
> > >
> > >> Thanks Mirko,
> > >> apart from JMS and JNDI-ed Broker, is there any other "out-of-the-box"
> > way
> > >> that you are aware of?
> > >>
> > >> On Tue, Feb 21, 2017 at 11:59 AM, Vogelsme <[hidden email]
> >
> > >> wrote:
> > >>
> > >> @Pierre
> > >>> Thats pretty much what we did. Will check out that page later.
> > >>>
> > >>> @Milan
> > >>> As I do not know what exactly your plan it is hard to help you.
> > >>> The OFBiz-Way would be to use the Serviceengine to connect to
> anything
> > >>> outside like an JMX Broker.
> > >>> You can define your own engine in the serviceengine.xml like '<engine
> > >>> name="jms" class="org.ofbiz.service.jms.JmsServiceEngine"/>'
> > >>> and define the service like (common/services_test.xml)
> > >>> <service name="testJMSQueue" engine="jms" location="serviceMessenger"
> > >>> invoke="testScv">...
> > >>>
> > >>> Distributed Cache Clear uses the same mechanism:
> > >>> https://cwiki.apache.org/confluence/display/OFBIZ/
> > >>> Distributed+Entity+Cache+Clear+(DCC)+Mechanism
> > >>>
> > >>>
> > >>>
> > >>> --
> > >>> View this message in context: http://ofbiz.135035.n4.nabble.
> > >>> com/send-events-from-ofbiz-tp4702636p4702683.html
> > >>> Sent from the OFBiz - User mailing list archive at Nabble.com.
> > >>>
> > >>>
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Problem consuming ofbiz soap services from PHP

Alfonso Barreto
Been trying to find and updated reference for this, but still haven't found it.
I try to consume the soap  testing services that comes on ofbiz, but for some reason, the parameters are not readed on the server part. This is the code Iam using on PHP, tryed several combinations but cant find the rigth one. 
Will appreciate some help.



            ini_set('soap.wsdl_cache_enabled', 0);
            ini_set('soap.wsdl_cache_ttl', 900);
            ini_set('default_socket_timeout', 15);

       
            //$wsdl = 'https://107.180.69.62/webtools/control/SOAPService/getProductInventoryAvailable?WSDL';
            //$wsdl = 'https://107.180.69.62/webtools/control/SOAPService/testRemoteSoap?WSDL';
            //$wsdl = 'https://107.180.69.62/webtools/control/SOAPService/testRemoteSoap1?WSDL';
            //$wsdl = 'https://107.180.69.62/webtools/control/SOAPService/testSoapSimple?WSDL';
            $wsdl = 'https://107.180.69.62/webtools/control/SOAPService/testSoap?WSDL';
            $wsdl = 'https://107.180.69.62/product/control/soapGetProductNames/soapWebService?WSDL';
            $data=null;
            $options = array(
        //'style'=>SOAP_RPC,
        //'use'=>SOAP_ENCODED,
        'soap_version'=>SOAP_1_2,
        //'cache_wsdl'=>WSDL_CACHE_NONE,
        'connection_timeout'=>15,
        'trace'=>true,
        'encoding'=>'UTF-8',
        'exceptions'=>true,
                );
            try {
                $soap = new SoapClient($wsdl,$options);
                //$soap->__soapCall('lupe','lupe','lupe1234','es',null,testSoapSimple', array($params));
                //$data = $soap->testSoapSimple(array('lupe','lupe','lupe1234','es',null,34.5,'testPrueba')); //$params);
                //$data = $soap->testSoap(array('lupe','lupe','lupe1234','es',null,34.5,'testPrueba'));
                //$data = $soap->testRemoteSoap(array(34.6,'Prueba2Test','lupe','lupe1234'));
                //$data = $soap->testRemoteSoap1(array('56789','LatLonListZipCode'));
                $data = $soap->soapWebService(array('prueba'));
            }
            catch(Exception $e) {
                print $e->getMessage();
            }
 
            var_dump($data);


In any combination I use, this is the log I get on the server:
2017-02-27 17:49:38,757 (http-0.0.0.0-443-10) [       VisitHandler.java:233:INFO ] Found visitorId [null] in cookie
2017-02-27 17:49:38,840 (http-0.0.0.0-443-10) [     RequestHandler.java:282:INFO ] This is the first request in this visit. sessionId=A41F2EF98F6C29894283AB3FAE4F739B.jvm1
2017-02-27 17:49:38,841 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.control.LoginWorker#check509CertLogin] from [preprocessor], result is [success]
2017-02-27 17:49:38,842 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.control.LoginWorker#checkRequestHeaderLogin] from [preprocessor], result is [success]
2017-02-27 17:49:38,842 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.control.LoginWorker#checkServletRequestRemoteUserLogin] from [preprocessor], result is [success]
2017-02-27 17:49:38,843 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.control.LoginWorker#checkExternalLoginKey] from [preprocessor], result is [success]
2017-02-27 17:49:38,844 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.control.ProtectViewWorker#checkProtectedView] from [preprocessor], result is [success]
2017-02-27 17:49:38,880 (http-0.0.0.0-443-10) [   SOAPEventHandler.java:160:INFO ] Request Message:
<?xml version="1.0" encoding="utf-8"?><env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://ofbiz.apache.org/service/"><env:Body><ns1:testSoap><map-Map><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry></map-Map></ns1:testSoap></env:Body></env:Envelope>

2017-02-27 17:49:38,897 (http-0.0.0.0-443-10) [   SOAPEventHandler.java:261:INFO ] Response Message:
<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><Response><map-Map>
        <map-Entry>
            <map-Key>
                <std-String value="errorMessage"></std-String>
            </map-Key>
            <map-Value>
                <null></null>
            </map-Value>
        </map-Entry>
    </map-Map></Response></soapenv:Body></soapenv:Envelope>

2017-02-27 17:49:38,899 (http-0.0.0.0-443-10) [     RequestHandler.java:421:ERROR] Request SOAPService caused an error with the following message: Error calling event: org.ofbiz.webapp.event.EventHandlerException
2017-02-27 17:49:38,900 (http-0.0.0.0-443-10) [       ServerHitBin.java:628:INFO ] Visit delegatorName=default, ServerHitBin delegatorName=default
2017-02-27 17:49:38,934 (http-0.0.0.0-443-10) [       ServerHitBin.java:722:INFO ] Duplicate ServerHit was updated: [GenericEntity:ServerHit][contentId,webtools.SOAPService(java.lang.String)][createdStamp,2017-02-27 17:49:38.903(java.sql.Timestamp)][createdTxStamp,2017-02-27 17:49:38.9(java.sql.Timestamp)][hitStartDateTime,2017-02-27 17:49:38.756(java.sql.Timestamp)][hitTypeId,REQUEST(java.lang.String)][lastUpdatedStamp,2017-02-27 17:49:38.903(java.sql.Timestamp)][lastUpdatedTxStamp,2017-02-27 17:49:38.9(java.sql.Timestamp)][referrerUrl,(java.lang.String)][requestUrl,https://107.180.69.62/webtools/control/SOAPService(java.lang.String)][runningTimeMillis,143(java.lang.Long)][serverHostName,s107-180-69-62.secureserver.net(java.lang.String)][serverIpAddress,107.180.69.62(java.lang.String)][visitId,11053(java.lang.String)]
2017-02-27 17:49:38,935 (http-0.0.0.0-443-10) [     ControlServlet.java:328:INFO ] [[[SOAPService] Request Done- total:0.177,since last([SOAPService] Req...):0.177]]
2017-02-27 17:50:29,461 (http-0.0.0.0-443-10) [ControlEventListener.java:65 :INFO ] Creating session: C458AFF4A31D8B54E2F7E547FC4DF4BA.jvm1
2017-02-27 17:50:29,462 (http-0.0.0.0-443-10) [      ContextFilter.java:202:INFO ] [Request]: /webtools/control/SOAPService/testSoap
2017-02-27 17:50:29,464 (http-0.0.0.0-443-10) [     ControlServlet.java:145:INFO ] [[[SOAPService] Request Begun, encoding=[UTF-8]- total:0.0,since last(Begin):0.0]]
2017-02-27 17:50:29,464 (http-0.0.0.0-443-10) [       VisitHandler.java:233:INFO ] Found visitorId [null] in cookie
2017-02-27 17:50:29,599 (http-0.0.0.0-443-10) [    ConfigXMLReader.java:184:INFO ] controller loaded: 0.0s, 23 requests, 16 views in file:/mnt/opentaps-1.5.0/framework/common/webcommon/WEB-INF/common-controller.xml
2017-02-27 17:50:29,602 (http-0.0.0.0-443-10) [    ConfigXMLReader.java:184:INFO ] controller loaded: 0.0s, 5 requests, 0 views in file:/mnt/opentaps-1.5.0/framework/common/webcommon/WEB-INF/tempexpr-controller.xml
2017-02-27 17:50:29,605 (http-0.0.0.0-443-10) [    ConfigXMLReader.java:184:INFO ] controller loaded: 0.0s, 8 requests, 2 views in file:/mnt/opentaps-1.5.0/framework/testtools/webapp/testtools/WEB-INF/controller.xml
2017-02-27 17:50:29,606 (http-0.0.0.0-443-10) [    ConfigXMLReader.java:184:INFO ] controller loaded: 0.01s, 110 requests, 64 views in file:/mnt/opentaps-1.5.0/framework/webtools/webapp/webtools/WEB-INF/controller.xml
2017-02-27 17:50:29,606 (http-0.0.0.0-443-10) [     RequestHandler.java:282:INFO ] This is the first request in this visit. sessionId=C458AFF4A31D8B54E2F7E547FC4DF4BA.jvm1
2017-02-27 17:50:29,607 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.control.LoginWorker#check509CertLogin] from [preprocessor], result is [success]
2017-02-27 17:50:29,608 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.control.LoginWorker#checkRequestHeaderLogin] from [preprocessor], result is [success]
2017-02-27 17:50:29,608 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.control.LoginWorker#checkServletRequestRemoteUserLogin] from [preprocessor], result is [success]
2017-02-27 17:50:29,609 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.control.LoginWorker#checkExternalLoginKey] from [preprocessor], result is [success]
2017-02-27 17:50:29,610 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.control.ProtectViewWorker#checkProtectedView] from [preprocessor], result is [success]
2017-02-27 17:50:29,623 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [soap:#] from [request], result is [null]
2017-02-27 17:50:29,624 (http-0.0.0.0-443-10) [       ServerHitBin.java:628:INFO ] Visit delegatorName=default, ServerHitBin delegatorName=default
2017-02-27 17:50:29,658 (http-0.0.0.0-443-10) [       ServerHitBin.java:722:INFO ] Duplicate ServerHit was updated: [GenericEntity:ServerHit][contentId,webtools.SOAPService(java.lang.String)][createdStamp,2017-02-27 17:50:29.628(java.sql.Timestamp)][createdTxStamp,2017-02-27 17:50:29.625(java.sql.Timestamp)][hitStartDateTime,2017-02-27 17:50:29.464(java.sql.Timestamp)][hitTypeId,REQUEST(java.lang.String)][lastUpdatedStamp,2017-02-27 17:50:29.628(java.sql.Timestamp)][lastUpdatedTxStamp,2017-02-27 17:50:29.625(java.sql.Timestamp)][referrerUrl,(java.lang.String)][requestUrl,https://107.180.69.62/webtools/control/SOAPService/testSoap?WSDL(java.lang.String)][runningTimeMillis,160(java.lang.Long)][serverHostName,s107-180-69-62.secureserver.net(java.lang.String)][serverIpAddress,107.180.69.62(java.lang.String)][visitId,11054(java.lang.String)]
2017-02-27 17:50:29,658 (http-0.0.0.0-443-10) [     ControlServlet.java:328:INFO ] [[[SOAPService] Request Done- total:0.194,since last([SOAPService] Req...):0.194]]
2017-02-27 17:50:31,362 (http-0.0.0.0-443-10) [ControlEventListener.java:65 :INFO ] Creating session: D5C0BEB00515DC3D18C765C9D85D1834.jvm1
2017-02-27 17:50:31,362 (http-0.0.0.0-443-10) [      ContextFilter.java:202:INFO ] [Request]: /webtools/control/SOAPService
2017-02-27 17:50:31,364 (http-0.0.0.0-443-10) [     ControlServlet.java:145:INFO ] [[[SOAPService] Request Begun, encoding=[utf-8]- total:0.0,since last(Begin):0.0]]
2017-02-27 17:50:31,365 (http-0.0.0.0-443-10) [       VisitHandler.java:233:INFO ] Found visitorId [null] in cookie
2017-02-27 17:50:31,458 (http-0.0.0.0-443-10) [     RequestHandler.java:282:INFO ] This is the first request in this visit. sessionId=D5C0BEB00515DC3D18C765C9D85D1834.jvm1
2017-02-27 17:50:31,459 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.control.LoginWorker#check509CertLogin] from [preprocessor], result is [success]
2017-02-27 17:50:31,460 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.control.LoginWorker#checkRequestHeaderLogin] from [preprocessor], result is [success]
2017-02-27 17:50:31,461 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.control.LoginWorker#checkServletRequestRemoteUserLogin] from [preprocessor], result is [success]
2017-02-27 17:50:31,461 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.control.LoginWorker#checkExternalLoginKey] from [preprocessor], result is [success]
2017-02-27 17:50:31,462 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.control.ProtectViewWorker#checkProtectedView] from [preprocessor], result is [success]
2017-02-27 17:50:31,473 (http-0.0.0.0-443-10) [   SOAPEventHandler.java:160:INFO ] Request Message:
<?xml version="1.0" encoding="utf-8"?><env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://ofbiz.apache.org/service/"><env:Body><ns1:testSoap><map-Map><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry></map-Map></ns1:testSoap></env:Body></env:Envelope>

2017-02-27 17:50:31,486 (http-0.0.0.0-443-10) [   SOAPEventHandler.java:261:INFO ] Response Message:
<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><Response><map-Map>
        <map-Entry>
            <map-Key>
                <std-String value="errorMessage"></std-String>
            </map-Key>
            <map-Value>
                <null></null>
            </map-Value>
        </map-Entry>
    </map-Map></Response></soapenv:Body></soapenv:Envelope>

2017-02-27 17:50:31,488 (http-0.0.0.0-443-10) [     RequestHandler.java:421:ERROR] Request SOAPService caused an error with the following message: Error calling event: org.ofbiz.webapp.event.EventHandlerException
2017-02-27 17:50:31,488 (http-0.0.0.0-443-10) [       ServerHitBin.java:628:INFO ] Visit delegatorName=default, ServerHitBin delegatorName=default
2017-02-27 17:50:31,530 (http-0.0.0.0-443-10) [       ServerHitBin.java:722:INFO ] Duplicate ServerHit was updated: [GenericEntity:ServerHit][contentId,webtools.SOAPService(java.lang.String)][createdStamp,2017-02-27 17:50:31.492(java.sql.Timestamp)][createdTxStamp,2017-02-27 17:50:31.489(java.sql.Timestamp)][hitStartDateTime,2017-02-27 17:50:31.364(java.sql.Timestamp)][hitTypeId,REQUEST(java.lang.String)][lastUpdatedStamp,2017-02-27 17:50:31.492(java.sql.Timestamp)][lastUpdatedTxStamp,2017-02-27 17:50:31.489(java.sql.Timestamp)][referrerUrl,(java.lang.String)][requestUrl,https://107.180.69.62/webtools/control/SOAPService(java.lang.String)][runningTimeMillis,124(java.lang.Long)][serverHostName,s107-180-69-62.secureserver.net(java.lang.String)][serverIpAddress,107.180.69.62(java.lang.String)][visitId,11055(java.lang.String)]
2017-02-27 17:50:31,530 (http-0.0.0.0-443-10) [     ControlServlet.java:328:INFO ] [[[SOAPService] Request Done- total:0.166,since last([SOAPService] Req...):0.166]]

Reply | Threaded
Open this post in threaded view
|

Re: Problem consuming ofbiz soap services from PHP

Paul Foxworthy
Hi Alfonso,

The log suggests to me that the parameters are not being *sent*: OFBiz is
just receiving an empty map:

<map-Map><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry><
/map-Entry><map-Entry></map-Entry><map-Entry></map-Entry><
map-Entry></map-Entry><map-Entry></map-Entry></map-Map>

A map entry has a key and a value. Try using the PHP syntax to create an
associative array:

array(
    key  => value,
    key2 => value2,
    key3 => value3,
    ...
);

You could try using something to see the exact SOAP message before OFBiz
processes it, perhaps SoapUI (soapui.org).

Hope that helps.

Paul Foxworthy


On 28 February 2017 at 10:52, Alfonso Barreto <[hidden email]>
wrote:

> Been trying to find and updated reference for this, but still haven't
> found it.
> I try to consume the soap  testing services that comes on ofbiz, but for
> some reason, the parameters are not readed on the server part. This is the
> code Iam using on PHP, tryed several combinations but cant find the rigth
> one.
> Will appreciate some help.
>
>
>
>             ini_set('soap.wsdl_cache_enabled', 0);
>             ini_set('soap.wsdl_cache_ttl', 900);
>             ini_set('default_socket_timeout', 15);
>
>
>             //$wsdl = 'https://107.180.69.62/webtools/control/SOAPService/
> getProductInventoryAvailable?WSDL';
>             //$wsdl = 'https://107.180.69.62/webtools/control/SOAPService/
> testRemoteSoap?WSDL';
>             //$wsdl = 'https://107.180.69.62/webtools/control/SOAPService/
> testRemoteSoap1?WSDL';
>             //$wsdl = 'https://107.180.69.62/webtools/control/SOAPService/
> testSoapSimple?WSDL';
>             $wsdl = 'https://107.180.69.62/webtools/control/SOAPService/
> testSoap?WSDL';
>             $wsdl = 'https://107.180.69.62/product/control/
> soapGetProductNames/soapWebService?WSDL';
>             $data=null;
>             $options = array(
>         //'style'=>SOAP_RPC,
>         //'use'=>SOAP_ENCODED,
>         'soap_version'=>SOAP_1_2,
>         //'cache_wsdl'=>WSDL_CACHE_NONE,
>         'connection_timeout'=>15,
>         'trace'=>true,
>         'encoding'=>'UTF-8',
>         'exceptions'=>true,
>                 );
>             try {
>                 $soap = new SoapClient($wsdl,$options);
>                 //$soap->__soapCall('lupe','lupe','lupe1234','es',null,testSoapSimple',
> array($params));
>                 //$data = $soap->testSoapSimple(array('
> lupe','lupe','lupe1234','es',null,34.5,'testPrueba')); //$params);
>                 //$data = $soap->testSoap(array('lupe','
> lupe','lupe1234','es',null,34.5,'testPrueba'));
>                 //$data = $soap->testRemoteSoap(array(
> 34.6,'Prueba2Test','lupe','lupe1234'));
>                 //$data = $soap->testRemoteSoap1(array('
> 56789','LatLonListZipCode'));
>                 $data = $soap->soapWebService(array('prueba'));
>             }
>             catch(Exception $e) {
>                 print $e->getMessage();
>             }
>
>             var_dump($data);
>
>
> In any combination I use, this is the log I get on the server:
> 2017-02-27 17:49:38,757 (http-0.0.0.0-443-10) [
> VisitHandler.java:233:INFO ] Found visitorId [null] in cookie
> 2017-02-27 17:49:38,840 (http-0.0.0.0-443-10) [
> RequestHandler.java:282:INFO ] This is the first request in this visit.
> sessionId=A41F2EF98F6C29894283AB3FAE4F739B.jvm1
> 2017-02-27 17:49:38,841 (http-0.0.0.0-443-10) [
> RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.
> control.LoginWorker#check509CertLogin] from [preprocessor], result is
> [success]
> 2017-02-27 17:49:38,842 (http-0.0.0.0-443-10) [
> RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.
> control.LoginWorker#checkRequestHeaderLogin] from [preprocessor], result
> is [success]
> 2017-02-27 17:49:38,842 (http-0.0.0.0-443-10) [
> RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.
> control.LoginWorker#checkServletRequestRemoteUserLogin] from
> [preprocessor], result is [success]
> 2017-02-27 17:49:38,843 (http-0.0.0.0-443-10) [
> RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.
> control.LoginWorker#checkExternalLoginKey] from [preprocessor], result is
> [success]
> 2017-02-27 17:49:38,844 (http-0.0.0.0-443-10) [
> RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.
> control.ProtectViewWorker#checkProtectedView] from [preprocessor], result
> is [success]
> 2017-02-27 17:49:38,880 (http-0.0.0.0-443-10) [
> SOAPEventHandler.java:160:INFO ] Request Message:
> <?xml version="1.0" encoding="utf-8"?><env:Envelope xmlns:env="
> http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://ofbiz.
> apache.org/service/"><env:Body><ns1:testSoap><map-Map><
> map-Entry></map-Entry><map-Entry></map-Entry><map-Entry><
> /map-Entry><map-Entry></map-Entry><map-Entry></map-Entry><
> map-Entry></map-Entry><map-Entry></map-Entry></map-Map></
> ns1:testSoap></env:Body></env:Envelope>
>
> 2017-02-27 17:49:38,897 (http-0.0.0.0-443-10) [
> SOAPEventHandler.java:261:INFO ] Response Message:
> <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><Response><map-
> Map>
>         <map-Entry>
>             <map-Key>
>                 <std-String value="errorMessage"></std-String>
>             </map-Key>
>             <map-Value>
>                 <null></null>
>             </map-Value>
>         </map-Entry>
>     </map-Map></Response></soapenv:Body></soapenv:Envelope>
>
> 2017-02-27 17:49:38,899 (http-0.0.0.0-443-10) [
> RequestHandler.java:421:ERROR] Request SOAPService caused an error with the
> following message: Error calling event: org.ofbiz.webapp.event.
> EventHandlerException
> 2017-02-27 17:49:38,900 (http-0.0.0.0-443-10) [
> ServerHitBin.java:628:INFO ] Visit delegatorName=default, ServerHitBin
> delegatorName=default
> 2017-02-27 17:49:38,934 (http-0.0.0.0-443-10) [
> ServerHitBin.java:722:INFO ] Duplicate ServerHit was updated:
> [GenericEntity:ServerHit][contentId,webtools.
> SOAPService(java.lang.String)][createdStamp,2017-02-27
> 17:49:38.903(java.sql.Timestamp)][createdTxStamp,2017-02-27
> 17:49:38.9(java.sql.Timestamp)][hitStartDateTime,2017-02-27
> 17:49:38.756(java.sql.Timestamp)][hitTypeId,REQUEST(java.lang.String)][lastUpdatedStamp,2017-02-27
> 17:49:38.903(java.sql.Timestamp)][lastUpdatedTxStamp,2017-02-27
> 17:49:38.9(java.sql.Timestamp)][referrerUrl,(java.lang.
> String)][requestUrl,https://107.180.69.62/webtools/
> control/SOAPService(java.lang.String)][runningTimeMillis,
> 143(java.lang.Long)][serverHostName,s107-180-69-62.
> secureserver.net(java.lang.String)][serverIpAddress,107.
> 180.69.62(java.lang.String)][visitId,11053(java.lang.String)]
> 2017-02-27 17:49:38,935 (http-0.0.0.0-443-10) [
> ControlServlet.java:328:INFO ] [[[SOAPService] Request Done-
> total:0.177,since last([SOAPService] Req...):0.177]]
> 2017-02-27 17:50:29,461 (http-0.0.0.0-443-10)
> [ControlEventListener.java:65 :INFO ] Creating session:
> C458AFF4A31D8B54E2F7E547FC4DF4BA.jvm1
> 2017-02-27 17:50:29,462 (http-0.0.0.0-443-10) [
> ContextFilter.java:202:INFO ] [Request]: /webtools/control/SOAPService/
> testSoap
> 2017-02-27 17:50:29,464 (http-0.0.0.0-443-10) [
> ControlServlet.java:145:INFO ] [[[SOAPService] Request Begun,
> encoding=[UTF-8]- total:0.0,since last(Begin):0.0]]
> 2017-02-27 17:50:29,464 (http-0.0.0.0-443-10) [
> VisitHandler.java:233:INFO ] Found visitorId [null] in cookie
> 2017-02-27 17:50:29,599 (http-0.0.0.0-443-10) [
> ConfigXMLReader.java:184:INFO ] controller loaded: 0.0s, 23 requests, 16
> views in file:/mnt/opentaps-1.5.0/framework/common/webcommon/
> WEB-INF/common-controller.xml
> 2017-02-27 17:50:29,602 (http-0.0.0.0-443-10) [
> ConfigXMLReader.java:184:INFO ] controller loaded: 0.0s, 5 requests, 0
> views in file:/mnt/opentaps-1.5.0/framework/common/webcommon/
> WEB-INF/tempexpr-controller.xml
> 2017-02-27 17:50:29,605 (http-0.0.0.0-443-10) [
> ConfigXMLReader.java:184:INFO ] controller loaded: 0.0s, 8 requests, 2
> views in file:/mnt/opentaps-1.5.0/framework/testtools/webapp/
> testtools/WEB-INF/controller.xml
> 2017-02-27 17:50:29,606 (http-0.0.0.0-443-10) [
> ConfigXMLReader.java:184:INFO ] controller loaded: 0.01s, 110 requests, 64
> views in file:/mnt/opentaps-1.5.0/framework/webtools/webapp/
> webtools/WEB-INF/controller.xml
> 2017-02-27 17:50:29,606 (http-0.0.0.0-443-10) [
> RequestHandler.java:282:INFO ] This is the first request in this visit.
> sessionId=C458AFF4A31D8B54E2F7E547FC4DF4BA.jvm1
> 2017-02-27 17:50:29,607 (http-0.0.0.0-443-10) [
> RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.
> control.LoginWorker#check509CertLogin] from [preprocessor], result is
> [success]
> 2017-02-27 17:50:29,608 (http-0.0.0.0-443-10) [
> RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.
> control.LoginWorker#checkRequestHeaderLogin] from [preprocessor], result
> is [success]
> 2017-02-27 17:50:29,608 (http-0.0.0.0-443-10) [
> RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.
> control.LoginWorker#checkServletRequestRemoteUserLogin] from
> [preprocessor], result is [success]
> 2017-02-27 17:50:29,609 (http-0.0.0.0-443-10) [
> RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.
> control.LoginWorker#checkExternalLoginKey] from [preprocessor], result is
> [success]
> 2017-02-27 17:50:29,610 (http-0.0.0.0-443-10) [
> RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.
> control.ProtectViewWorker#checkProtectedView] from [preprocessor], result
> is [success]
> 2017-02-27 17:50:29,623 (http-0.0.0.0-443-10) [
> RequestHandler.java:641:INFO ] Ran Event [soap:#] from [request], result is
> [null]
> 2017-02-27 17:50:29,624 (http-0.0.0.0-443-10) [
> ServerHitBin.java:628:INFO ] Visit delegatorName=default, ServerHitBin
> delegatorName=default
> 2017-02-27 17:50:29,658 (http-0.0.0.0-443-10) [
> ServerHitBin.java:722:INFO ] Duplicate ServerHit was updated:
> [GenericEntity:ServerHit][contentId,webtools.
> SOAPService(java.lang.String)][createdStamp,2017-02-27
> 17:50:29.628(java.sql.Timestamp)][createdTxStamp,2017-02-27
> 17:50:29.625(java.sql.Timestamp)][hitStartDateTime,2017-02-27
> 17:50:29.464(java.sql.Timestamp)][hitTypeId,REQUEST(java.lang.String)][lastUpdatedStamp,2017-02-27
> 17:50:29.628(java.sql.Timestamp)][lastUpdatedTxStamp,2017-02-27
> 17:50:29.625(java.sql.Timestamp)][referrerUrl,(java.
> lang.String)][requestUrl,https://107.180.69.62/webtools/
> control/SOAPService/testSoap?WSDL(java.lang.String)][
> runningTimeMillis,160(java.lang.Long)][serverHostName,
> s107-180-69-62.secureserver.net(java.lang.String)][
> serverIpAddress,107.180.69.62(java.lang.String)][visitId,
> 11054(java.lang.String)]
> 2017-02-27 17:50:29,658 (http-0.0.0.0-443-10) [
> ControlServlet.java:328:INFO ] [[[SOAPService] Request Done-
> total:0.194,since last([SOAPService] Req...):0.194]]
> 2017-02-27 17:50:31,362 (http-0.0.0.0-443-10)
> [ControlEventListener.java:65 :INFO ] Creating session:
> D5C0BEB00515DC3D18C765C9D85D1834.jvm1
> 2017-02-27 17:50:31,362 (http-0.0.0.0-443-10) [
> ContextFilter.java:202:INFO ] [Request]: /webtools/control/SOAPService
> 2017-02-27 17:50:31,364 (http-0.0.0.0-443-10) [
> ControlServlet.java:145:INFO ] [[[SOAPService] Request Begun,
> encoding=[utf-8]- total:0.0,since last(Begin):0.0]]
> 2017-02-27 17:50:31,365 (http-0.0.0.0-443-10) [
> VisitHandler.java:233:INFO ] Found visitorId [null] in cookie
> 2017-02-27 17:50:31,458 (http-0.0.0.0-443-10) [
> RequestHandler.java:282:INFO ] This is the first request in this visit.
> sessionId=D5C0BEB00515DC3D18C765C9D85D1834.jvm1
> 2017-02-27 17:50:31,459 (http-0.0.0.0-443-10) [
> RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.
> control.LoginWorker#check509CertLogin] from [preprocessor], result is
> [success]
> 2017-02-27 17:50:31,460 (http-0.0.0.0-443-10) [
> RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.
> control.LoginWorker#checkRequestHeaderLogin] from [preprocessor], result
> is [success]
> 2017-02-27 17:50:31,461 (http-0.0.0.0-443-10) [
> RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.
> control.LoginWorker#checkServletRequestRemoteUserLogin] from
> [preprocessor], result is [success]
> 2017-02-27 17:50:31,461 (http-0.0.0.0-443-10) [
> RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.
> control.LoginWorker#checkExternalLoginKey] from [preprocessor], result is
> [success]
> 2017-02-27 17:50:31,462 (http-0.0.0.0-443-10) [
> RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp.
> control.ProtectViewWorker#checkProtectedView] from [preprocessor], result
> is [success]
> 2017-02-27 17:50:31,473 (http-0.0.0.0-443-10) [
> SOAPEventHandler.java:160:INFO ] Request Message:
> <?xml version="1.0" encoding="utf-8"?><env:Envelope xmlns:env="
> http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://ofbiz.
> apache.org/service/"><env:Body><ns1:testSoap><map-Map><
> map-Entry></map-Entry><map-Entry></map-Entry><map-Entry><
> /map-Entry><map-Entry></map-Entry><map-Entry></map-Entry><
> map-Entry></map-Entry><map-Entry></map-Entry></map-Map></
> ns1:testSoap></env:Body></env:Envelope>
>
> 2017-02-27 17:50:31,486 (http-0.0.0.0-443-10) [
> SOAPEventHandler.java:261:INFO ] Response Message:
> <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><Response><map-
> Map>
>         <map-Entry>
>             <map-Key>
>                 <std-String value="errorMessage"></std-String>
>             </map-Key>
>             <map-Value>
>                 <null></null>
>             </map-Value>
>         </map-Entry>
>     </map-Map></Response></soapenv:Body></soapenv:Envelope>
>
> 2017-02-27 17:50:31,488 (http-0.0.0.0-443-10) [
> RequestHandler.java:421:ERROR] Request SOAPService caused an error with the
> following message: Error calling event: org.ofbiz.webapp.event.
> EventHandlerException
> 2017-02-27 17:50:31,488 (http-0.0.0.0-443-10) [
> ServerHitBin.java:628:INFO ] Visit delegatorName=default, ServerHitBin
> delegatorName=default
> 2017-02-27 17:50:31,530 (http-0.0.0.0-443-10) [
> ServerHitBin.java:722:INFO ] Duplicate ServerHit was updated:
> [GenericEntity:ServerHit][contentId,webtools.
> SOAPService(java.lang.String)][createdStamp,2017-02-27
> 17:50:31.492(java.sql.Timestamp)][createdTxStamp,2017-02-27
> 17:50:31.489(java.sql.Timestamp)][hitStartDateTime,2017-02-27
> 17:50:31.364(java.sql.Timestamp)][hitTypeId,REQUEST(java.lang.String)][lastUpdatedStamp,2017-02-27
> 17:50:31.492(java.sql.Timestamp)][lastUpdatedTxStamp,2017-02-27
> 17:50:31.489(java.sql.Timestamp)][referrerUrl,(java.
> lang.String)][requestUrl,https://107.180.69.62/webtools/
> control/SOAPService(java.lang.String)][runningTimeMillis,
> 124(java.lang.Long)][serverHostName,s107-180-69-62.
> secureserver.net(java.lang.String)][serverIpAddress,107.
> 180.69.62(java.lang.String)][visitId,11055(java.lang.String)]
> 2017-02-27 17:50:31,530 (http-0.0.0.0-443-10) [
> ControlServlet.java:328:INFO ] [[[SOAPService] Request Done-
> total:0.166,since last([SOAPService] Req...):0.166]]
>
>


--
Coherent Software Australia Pty Ltd
PO Box 2773
Cheltenham Vic 3192
Australia

Phone: +61 3 9585 6788
Web: http://www.coherentsoftware.com.au/
Email: [hidden email]
--
Coherent Software Australia Pty Ltd
http://www.coherentsoftware.com.au/

Bonsai ERP, the all-inclusive ERP system
http://www.bonsaierp.com.au/
Reply | Threaded
Open this post in threaded view
|

Re: Problem consuming ofbiz soap services from PHP

Alfonso Barreto
Thanks Paul, I tryed that syntax too, but apparently the one that works better is the one I show, with the one you say it generates an exception on the client side, just after sending.

      From: Paul Foxworthy <[hidden email]>
 To: [hidden email]; Alfonso Barreto <[hidden email]>
 Sent: Monday, February 27, 2017 6:51 PM
 Subject: Re: Problem consuming ofbiz soap services from PHP
   
Hi Alfonso,
The log suggests to me that the parameters are not being *sent*: OFBiz is just receiving an empty map:
<map-Map><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry></map-Map>

A map entry has a key and a value. Try using the PHP syntax to create an associative array:
array(    key  => value,    key2 => value2,    key3 => value3,    ...);
You could try using something to see the exact SOAP message before OFBiz processes it, perhaps SoapUI (soapui.org).
Hope that helps.
Paul Foxworthy

On 28 February 2017 at 10:52, Alfonso Barreto <[hidden email]> wrote:

Been trying to find and updated reference for this, but still haven't found it.
I try to consume the soap  testing services that comes on ofbiz, but for some reason, the parameters are not readed on the server part. This is the code Iam using on PHP, tryed several combinations but cant find the rigth one. 
Will appreciate some help.



            ini_set('soap. wsdl_cache_enabled', 0);
            ini_set('soap.wsdl_cache_ttl', 900);
            ini_set('default_socket_ timeout', 15);

       
            //$wsdl = 'https://107.180.69.62/ webtools/control/SOAPService/ getProductInventoryAvailable? WSDL';
            //$wsdl = 'https://107.180.69.62/ webtools/control/SOAPService/ testRemoteSoap?WSDL';
            //$wsdl = 'https://107.180.69.62/ webtools/control/SOAPService/ testRemoteSoap1?WSDL';
            //$wsdl = 'https://107.180.69.62/ webtools/control/SOAPService/ testSoapSimple?WSDL';
            $wsdl = 'https://107.180.69.62/ webtools/control/SOAPService/ testSoap?WSDL';
            $wsdl = 'https://107.180.69.62/ product/control/ soapGetProductNames/ soapWebService?WSDL';
            $data=null;
            $options = array(
        //'style'=>SOAP_RPC,
        //'use'=>SOAP_ENCODED,
        'soap_version'=>SOAP_1_2,
        //'cache_wsdl'=>WSDL_CACHE_ NONE,
        'connection_timeout'=>15,
        'trace'=>true,
        'encoding'=>'UTF-8',
        'exceptions'=>true,
                );
            try {
                $soap = new SoapClient($wsdl,$options);
                //$soap->__soapCall('lupe',' lupe','lupe1234','es',null, testSoapSimple', array($params));
                //$data = $soap->testSoapSimple(array(' lupe','lupe','lupe1234','es', null,34.5,'testPrueba')); //$params);
                //$data = $soap->testSoap(array('lupe',' lupe','lupe1234','es',null,34. 5,'testPrueba'));
                //$data = $soap->testRemoteSoap(array( 34.6,'Prueba2Test','lupe',' lupe1234'));
                //$data = $soap->testRemoteSoap1(array(' 56789','LatLonListZipCode'));
                $data = $soap->soapWebService(array(' prueba'));
            }
            catch(Exception $e) {
                print $e->getMessage();
            }
 
            var_dump($data);


In any combination I use, this is the log I get on the server:
2017-02-27 17:49:38,757 (http-0.0.0.0-443-10) [       VisitHandler.java:233:INFO ] Found visitorId [null] in cookie
2017-02-27 17:49:38,840 (http-0.0.0.0-443-10) [     RequestHandler.java:282:INFO ] This is the first request in this visit. sessionId= A41F2EF98F6C29894283AB3FAE4F73 9B.jvm1
2017-02-27 17:49:38,841 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# check509CertLogin] from [preprocessor], result is [success]
2017-02-27 17:49:38,842 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkRequestHeaderLogin] from [preprocessor], result is [success]
2017-02-27 17:49:38,842 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkServletRequestRemoteUserL ogin] from [preprocessor], result is [success]
2017-02-27 17:49:38,843 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkExternalLoginKey] from [preprocessor], result is [success]
2017-02-27 17:49:38,844 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.ProtectViewWorker# checkProtectedView] from [preprocessor], result is [success]
2017-02-27 17:49:38,880 (http-0.0.0.0-443-10) [   SOAPEventHandler.java:160:INFO ] Request Message:
<?xml version="1.0" encoding="utf-8"?><env: Envelope xmlns:env="http://www.w3.org/ 2003/05/soap-envelope" xmlns:ns1="http://ofbiz. apache.org/service/"><env: Body><ns1:testSoap><map-Map>< map-Entry></map-Entry><map- Entry></map-Entry><map-Entry>< /map-Entry><map-Entry></map- Entry><map-Entry></map-Entry>< map-Entry></map-Entry><map- Entry></map-Entry></map-Map></ ns1:testSoap></env:Body></env: Envelope>

2017-02-27 17:49:38,897 (http-0.0.0.0-443-10) [   SOAPEventHandler.java:261:INFO ] Response Message:
<?xml version="1.0" encoding="utf-8"?><soapenv: Envelope xmlns:soapenv="http://schemas. xmlsoap.org/soap/envelope/">< soapenv:Body><Response><map- Map>
        <map-Entry>
            <map-Key>
                <std-String value="errorMessage"></std- String>
            </map-Key>
            <map-Value>
                <null></null>
            </map-Value>
        </map-Entry>
    </map-Map></Response></ soapenv:Body></soapenv: Envelope>

2017-02-27 17:49:38,899 (http-0.0.0.0-443-10) [     RequestHandler.java:421:ERROR] Request SOAPService caused an error with the following message: Error calling event: org.ofbiz.webapp.event. EventHandlerException
2017-02-27 17:49:38,900 (http-0.0.0.0-443-10) [       ServerHitBin.java:628:INFO ] Visit delegatorName=default, ServerHitBin delegatorName=default
2017-02-27 17:49:38,934 (http-0.0.0.0-443-10) [       ServerHitBin.java:722:INFO ] Duplicate ServerHit was updated: [GenericEntity:ServerHit][ contentId,webtools. SOAPService(java.lang.String)] [createdStamp,2017-02-27 17:49:38.903(java.sql. Timestamp)][createdTxStamp, 2017-02-27 17:49:38.9(java.sql.Timestamp) ][hitStartDateTime,2017-02-27 17:49:38.756(java.sql. Timestamp)][hitTypeId,REQUEST( java.lang.String)][ lastUpdatedStamp,2017-02-27 17:49:38.903(java.sql. Timestamp)][ lastUpdatedTxStamp,2017-02-27 17:49:38.9(java.sql.Timestamp) ][referrerUrl,(java.lang. String)][requestUrl,https:// 107.180.69.62/webtools/ control/SOAPService(java.lang. String)][runningTimeMillis, 143(java.lang.Long)][ serverHostName,s107-180-69-62. secureserver.net(java.lang. String)][serverIpAddress,107. 180.69.62(java.lang.String)][ visitId,11053(java.lang. String)]
2017-02-27 17:49:38,935 (http-0.0.0.0-443-10) [     ControlServlet.java:328:INFO ] [[[SOAPService] Request Done- total:0.177,since last([SOAPService] Req...):0.177]]
2017-02-27 17:50:29,461 (http-0.0.0.0-443-10) [ControlEventListener.java:65 :INFO ] Creating session: C458AFF4A31D8B54E2F7E547FC4DF4 BA.jvm1
2017-02-27 17:50:29,462 (http-0.0.0.0-443-10) [      ContextFilter.java:202:INFO ] [Request]: /webtools/control/SOAPService/ testSoap
2017-02-27 17:50:29,464 (http-0.0.0.0-443-10) [     ControlServlet.java:145:INFO ] [[[SOAPService] Request Begun, encoding=[UTF-8]- total:0.0,since last(Begin):0.0]]
2017-02-27 17:50:29,464 (http-0.0.0.0-443-10) [       VisitHandler.java:233:INFO ] Found visitorId [null] in cookie
2017-02-27 17:50:29,599 (http-0.0.0.0-443-10) [    ConfigXMLReader.java:184:INFO ] controller loaded: 0.0s, 23 requests, 16 views in file:/mnt/opentaps-1.5.0/ framework/common/webcommon/ WEB-INF/common-controller.xml
2017-02-27 17:50:29,602 (http-0.0.0.0-443-10) [    ConfigXMLReader.java:184:INFO ] controller loaded: 0.0s, 5 requests, 0 views in file:/mnt/opentaps-1.5.0/ framework/common/webcommon/ WEB-INF/tempexpr-controller. xml
2017-02-27 17:50:29,605 (http-0.0.0.0-443-10) [    ConfigXMLReader.java:184:INFO ] controller loaded: 0.0s, 8 requests, 2 views in file:/mnt/opentaps-1.5.0/ framework/testtools/webapp/ testtools/WEB-INF/controller. xml
2017-02-27 17:50:29,606 (http-0.0.0.0-443-10) [    ConfigXMLReader.java:184:INFO ] controller loaded: 0.01s, 110 requests, 64 views in file:/mnt/opentaps-1.5.0/ framework/webtools/webapp/ webtools/WEB-INF/controller. xml
2017-02-27 17:50:29,606 (http-0.0.0.0-443-10) [     RequestHandler.java:282:INFO ] This is the first request in this visit. sessionId= C458AFF4A31D8B54E2F7E547FC4DF4 BA.jvm1
2017-02-27 17:50:29,607 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# check509CertLogin] from [preprocessor], result is [success]
2017-02-27 17:50:29,608 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkRequestHeaderLogin] from [preprocessor], result is [success]
2017-02-27 17:50:29,608 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkServletRequestRemoteUserL ogin] from [preprocessor], result is [success]
2017-02-27 17:50:29,609 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkExternalLoginKey] from [preprocessor], result is [success]
2017-02-27 17:50:29,610 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.ProtectViewWorker# checkProtectedView] from [preprocessor], result is [success]
2017-02-27 17:50:29,623 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [soap:#] from [request], result is [null]
2017-02-27 17:50:29,624 (http-0.0.0.0-443-10) [       ServerHitBin.java:628:INFO ] Visit delegatorName=default, ServerHitBin delegatorName=default
2017-02-27 17:50:29,658 (http-0.0.0.0-443-10) [       ServerHitBin.java:722:INFO ] Duplicate ServerHit was updated: [GenericEntity:ServerHit][ contentId,webtools. SOAPService(java.lang.String)] [createdStamp,2017-02-27 17:50:29.628(java.sql. Timestamp)][createdTxStamp, 2017-02-27 17:50:29.625(java.sql. Timestamp)][hitStartDateTime, 2017-02-27 17:50:29.464(java.sql. Timestamp)][hitTypeId,REQUEST( java.lang.String)][ lastUpdatedStamp,2017-02-27 17:50:29.628(java.sql. Timestamp)][ lastUpdatedTxStamp,2017-02-27 17:50:29.625(java.sql. Timestamp)][referrerUrl,(java. lang.String)][requestUrl,https ://107.180.69.62/webtools/ control/SOAPService/testSoap? WSDL(java.lang.String)][ runningTimeMillis,160(java. lang.Long)][serverHostName, s107-180-69-62.secureserver. net(java.lang.String)][ serverIpAddress,107.180.69.62( java.lang.String)][visitId, 11054(java.lang.String)]
2017-02-27 17:50:29,658 (http-0.0.0.0-443-10) [     ControlServlet.java:328:INFO ] [[[SOAPService] Request Done- total:0.194,since last([SOAPService] Req...):0.194]]
2017-02-27 17:50:31,362 (http-0.0.0.0-443-10) [ControlEventListener.java:65 :INFO ] Creating session: D5C0BEB00515DC3D18C765C9D85D18 34.jvm1
2017-02-27 17:50:31,362 (http-0.0.0.0-443-10) [      ContextFilter.java:202:INFO ] [Request]: /webtools/control/SOAPService
2017-02-27 17:50:31,364 (http-0.0.0.0-443-10) [     ControlServlet.java:145:INFO ] [[[SOAPService] Request Begun, encoding=[utf-8]- total:0.0,since last(Begin):0.0]]
2017-02-27 17:50:31,365 (http-0.0.0.0-443-10) [       VisitHandler.java:233:INFO ] Found visitorId [null] in cookie
2017-02-27 17:50:31,458 (http-0.0.0.0-443-10) [     RequestHandler.java:282:INFO ] This is the first request in this visit. sessionId= D5C0BEB00515DC3D18C765C9D85D18 34.jvm1
2017-02-27 17:50:31,459 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# check509CertLogin] from [preprocessor], result is [success]
2017-02-27 17:50:31,460 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkRequestHeaderLogin] from [preprocessor], result is [success]
2017-02-27 17:50:31,461 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkServletRequestRemoteUserL ogin] from [preprocessor], result is [success]
2017-02-27 17:50:31,461 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkExternalLoginKey] from [preprocessor], result is [success]
2017-02-27 17:50:31,462 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.ProtectViewWorker# checkProtectedView] from [preprocessor], result is [success]
2017-02-27 17:50:31,473 (http-0.0.0.0-443-10) [   SOAPEventHandler.java:160:INFO ] Request Message:
<?xml version="1.0" encoding="utf-8"?><env: Envelope xmlns:env="http://www.w3.org/ 2003/05/soap-envelope" xmlns:ns1="http://ofbiz. apache.org/service/"><env: Body><ns1:testSoap><map-Map>< map-Entry></map-Entry><map- Entry></map-Entry><map-Entry>< /map-Entry><map-Entry></map- Entry><map-Entry></map-Entry>< map-Entry></map-Entry><map- Entry></map-Entry></map-Map></ ns1:testSoap></env:Body></env: Envelope>

2017-02-27 17:50:31,486 (http-0.0.0.0-443-10) [   SOAPEventHandler.java:261:INFO ] Response Message:
<?xml version="1.0" encoding="utf-8"?><soapenv: Envelope xmlns:soapenv="http://schemas. xmlsoap.org/soap/envelope/">< soapenv:Body><Response><map- Map>
        <map-Entry>
            <map-Key>
                <std-String value="errorMessage"></std- String>
            </map-Key>
            <map-Value>
                <null></null>
            </map-Value>
        </map-Entry>
    </map-Map></Response></ soapenv:Body></soapenv: Envelope>

2017-02-27 17:50:31,488 (http-0.0.0.0-443-10) [     RequestHandler.java:421:ERROR] Request SOAPService caused an error with the following message: Error calling event: org.ofbiz.webapp.event. EventHandlerException
2017-02-27 17:50:31,488 (http-0.0.0.0-443-10) [       ServerHitBin.java:628:INFO ] Visit delegatorName=default, ServerHitBin delegatorName=default
2017-02-27 17:50:31,530 (http-0.0.0.0-443-10) [       ServerHitBin.java:722:INFO ] Duplicate ServerHit was updated: [GenericEntity:ServerHit][ contentId,webtools. SOAPService(java.lang.String)] [createdStamp,2017-02-27 17:50:31.492(java.sql. Timestamp)][createdTxStamp, 2017-02-27 17:50:31.489(java.sql. Timestamp)][hitStartDateTime, 2017-02-27 17:50:31.364(java.sql. Timestamp)][hitTypeId,REQUEST( java.lang.String)][ lastUpdatedStamp,2017-02-27 17:50:31.492(java.sql. Timestamp)][ lastUpdatedTxStamp,2017-02-27 17:50:31.489(java.sql. Timestamp)][referrerUrl,(java. lang.String)][requestUrl,https ://107.180.69.62/webtools/ control/SOAPService(java.lang. String)][runningTimeMillis, 124(java.lang.Long)][ serverHostName,s107-180-69-62. secureserver.net(java.lang. String)][serverIpAddress,107. 180.69.62(java.lang.String)][ visitId,11055(java.lang. String)]
2017-02-27 17:50:31,530 (http-0.0.0.0-443-10) [     ControlServlet.java:328:INFO ] [[[SOAPService] Request Done- total:0.166,since last([SOAPService] Req...):0.166]]





--
Coherent Software Australia Pty Ltd
PO Box 2773
Cheltenham Vic 3192Australia
Phone: +61 3 9585 6788
Web: http://www.coherentsoftware.com.au/
Email: [hidden email]


   
Reply | Threaded
Open this post in threaded view
|

Re: Problem consuming ofbiz soap services from PHP

Shi Jinghai-3
In reply to this post by Alfonso Barreto
Hi Alfonso,

Perhaps you can try axis2 directly to see whether it's worked well. If yes, you can add axis2 to OFBiz as a plugin.

I built an axis2 component several years ago, I'm not sure whether I can find it.

Kind Regards,

Shi Jinghai

-----邮件原件-----
发件人: Alfonso Barreto [mailto:[hidden email]]
发送时间: 2017年2月28日 8:54
收件人: Paul Foxworthy; [hidden email]
主题: Re: Problem consuming ofbiz soap services from PHP

Thanks Paul, I tryed that syntax too, but apparently the one that works better is the one I show, with the one you say it generates an exception on the client side, just after sending.

      From: Paul Foxworthy <[hidden email]>
 To: [hidden email]; Alfonso Barreto <[hidden email]>
 Sent: Monday, February 27, 2017 6:51 PM
 Subject: Re: Problem consuming ofbiz soap services from PHP
   
Hi Alfonso,
The log suggests to me that the parameters are not being *sent*: OFBiz is just receiving an empty map:
<map-Map><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry></map-Map>

A map entry has a key and a value. Try using the PHP syntax to create an associative array:
array(    key  => value,    key2 => value2,    key3 => value3,    ...); You could try using something to see the exact SOAP message before OFBiz processes it, perhaps SoapUI (soapui.org).
Hope that helps.
Paul Foxworthy

On 28 February 2017 at 10:52, Alfonso Barreto <[hidden email]> wrote:

Been trying to find and updated reference for this, but still haven't found it.
I try to consume the soap  testing services that comes on ofbiz, but for some reason, the parameters are not readed on the server part. This is the code Iam using on PHP, tryed several combinations but cant find the rigth one. Will appreciate some help.



            ini_set('soap. wsdl_cache_enabled', 0);
            ini_set('soap.wsdl_cache_ttl', 900);
            ini_set('default_socket_ timeout', 15);

       
            //$wsdl = 'https://107.180.69.62/ webtools/control/SOAPService/ getProductInventoryAvailable? WSDL';
            //$wsdl = 'https://107.180.69.62/ webtools/control/SOAPService/ testRemoteSoap?WSDL';
            //$wsdl = 'https://107.180.69.62/ webtools/control/SOAPService/ testRemoteSoap1?WSDL';
            //$wsdl = 'https://107.180.69.62/ webtools/control/SOAPService/ testSoapSimple?WSDL';
            $wsdl = 'https://107.180.69.62/ webtools/control/SOAPService/ testSoap?WSDL';
            $wsdl = 'https://107.180.69.62/ product/control/ soapGetProductNames/ soapWebService?WSDL';
            $data=null;
            $options = array(
        //'style'=>SOAP_RPC,
        //'use'=>SOAP_ENCODED,
        'soap_version'=>SOAP_1_2,
        //'cache_wsdl'=>WSDL_CACHE_ NONE,
        'connection_timeout'=>15,
        'trace'=>true,
        'encoding'=>'UTF-8',
        'exceptions'=>true,
                );
            try {
                $soap = new SoapClient($wsdl,$options);
                //$soap->__soapCall('lupe',' lupe','lupe1234','es',null, testSoapSimple', array($params));
                //$data = $soap->testSoapSimple(array(' lupe','lupe','lupe1234','es', null,34.5,'testPrueba')); //$params);
                //$data = $soap->testSoap(array('lupe',' lupe','lupe1234','es',null,34. 5,'testPrueba'));
                //$data = $soap->testRemoteSoap(array( 34.6,'Prueba2Test','lupe',' lupe1234'));
                //$data = $soap->testRemoteSoap1(array(' 56789','LatLonListZipCode'));
                $data = $soap->soapWebService(array(' prueba'));
            }
            catch(Exception $e) {
                print $e->getMessage();
            }
 
            var_dump($data);


In any combination I use, this is the log I get on the server:
2017-02-27 17:49:38,757 (http-0.0.0.0-443-10) [       VisitHandler.java:233:INFO ] Found visitorId [null] in cookie
2017-02-27 17:49:38,840 (http-0.0.0.0-443-10) [     RequestHandler.java:282:INFO ] This is the first request in this visit. sessionId= A41F2EF98F6C29894283AB3FAE4F73 9B.jvm1
2017-02-27 17:49:38,841 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# check509CertLogin] from [preprocessor], result is [success]
2017-02-27 17:49:38,842 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkRequestHeaderLogin] from [preprocessor], result is [success]
2017-02-27 17:49:38,842 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkServletRequestRemoteUserL ogin] from [preprocessor], result is [success]
2017-02-27 17:49:38,843 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkExternalLoginKey] from [preprocessor], result is [success]
2017-02-27 17:49:38,844 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.ProtectViewWorker# checkProtectedView] from [preprocessor], result is [success]
2017-02-27 17:49:38,880 (http-0.0.0.0-443-10) [   SOAPEventHandler.java:160:INFO ] Request Message:
<?xml version="1.0" encoding="utf-8"?><env: Envelope xmlns:env="http://www.w3.org/ 2003/05/soap-envelope" xmlns:ns1="http://ofbiz. apache.org/service/"><env: Body><ns1:testSoap><map-Map>< map-Entry></map-Entry><map- Entry></map-Entry><map-Entry>< /map-Entry><map-Entry></map- Entry><map-Entry></map-Entry>< map-Entry></map-Entry><map- Entry></map-Entry></map-Map></ ns1:testSoap></env:Body></env: Envelope>

2017-02-27 17:49:38,897 (http-0.0.0.0-443-10) [   SOAPEventHandler.java:261:INFO ] Response Message:
<?xml version="1.0" encoding="utf-8"?><soapenv: Envelope xmlns:soapenv="http://schemas. xmlsoap.org/soap/envelope/">< soapenv:Body><Response><map- Map>
        <map-Entry>
            <map-Key>
                <std-String value="errorMessage"></std- String>
            </map-Key>
            <map-Value>
                <null></null>
            </map-Value>
        </map-Entry>
    </map-Map></Response></ soapenv:Body></soapenv: Envelope>

2017-02-27 17:49:38,899 (http-0.0.0.0-443-10) [     RequestHandler.java:421:ERROR] Request SOAPService caused an error with the following message: Error calling event: org.ofbiz.webapp.event. EventHandlerException
2017-02-27 17:49:38,900 (http-0.0.0.0-443-10) [       ServerHitBin.java:628:INFO ] Visit delegatorName=default, ServerHitBin delegatorName=default
2017-02-27 17:49:38,934 (http-0.0.0.0-443-10) [       ServerHitBin.java:722:INFO ] Duplicate ServerHit was updated: [GenericEntity:ServerHit][ contentId,webtools. SOAPService(java.lang.String)] [createdStamp,2017-02-27 17:49:38.903(java.sql. Timestamp)][createdTxStamp, 2017-02-27 17:49:38.9(java.sql.Timestamp) ][hitStartDateTime,2017-02-27 17:49:38.756(java.sql. Timestamp)][hitTypeId,REQUEST( java.lang.String)][ lastUpdatedStamp,2017-02-27 17:49:38.903(java.sql. Timestamp)][ lastUpdatedTxStamp,2017-02-27 17:49:38.9(java.sql.Timestamp) ][referrerUrl,(java.lang. String)][requestUrl,https:// 107.180.69.62/webtools/ control/SOAPService(java.lang. String)][runningTimeMillis, 143(java.lang.Long)][ serverHostName,s107-180-69-62. secureserver.net(java.lang. String)][serverIpAddress,107. 180.69.62(java.lang.String)][ visitId,11053(java.lang. String)]
2017-02-27 17:49:38,935 (http-0.0.0.0-443-10) [     ControlServlet.java:328:INFO ] [[[SOAPService] Request Done- total:0.177,since last([SOAPService] Req...):0.177]]
2017-02-27 17:50:29,461 (http-0.0.0.0-443-10) [ControlEventListener.java:65 :INFO ] Creating session: C458AFF4A31D8B54E2F7E547FC4DF4 BA.jvm1
2017-02-27 17:50:29,462 (http-0.0.0.0-443-10) [      ContextFilter.java:202:INFO ] [Request]: /webtools/control/SOAPService/ testSoap
2017-02-27 17:50:29,464 (http-0.0.0.0-443-10) [     ControlServlet.java:145:INFO ] [[[SOAPService] Request Begun, encoding=[UTF-8]- total:0.0,since last(Begin):0.0]]
2017-02-27 17:50:29,464 (http-0.0.0.0-443-10) [       VisitHandler.java:233:INFO ] Found visitorId [null] in cookie
2017-02-27 17:50:29,599 (http-0.0.0.0-443-10) [    ConfigXMLReader.java:184:INFO ] controller loaded: 0.0s, 23 requests, 16 views in file:/mnt/opentaps-1.5.0/ framework/common/webcommon/ WEB-INF/common-controller.xml
2017-02-27 17:50:29,602 (http-0.0.0.0-443-10) [    ConfigXMLReader.java:184:INFO ] controller loaded: 0.0s, 5 requests, 0 views in file:/mnt/opentaps-1.5.0/ framework/common/webcommon/ WEB-INF/tempexpr-controller. xml
2017-02-27 17:50:29,605 (http-0.0.0.0-443-10) [    ConfigXMLReader.java:184:INFO ] controller loaded: 0.0s, 8 requests, 2 views in file:/mnt/opentaps-1.5.0/ framework/testtools/webapp/ testtools/WEB-INF/controller. xml
2017-02-27 17:50:29,606 (http-0.0.0.0-443-10) [    ConfigXMLReader.java:184:INFO ] controller loaded: 0.01s, 110 requests, 64 views in file:/mnt/opentaps-1.5.0/ framework/webtools/webapp/ webtools/WEB-INF/controller. xml
2017-02-27 17:50:29,606 (http-0.0.0.0-443-10) [     RequestHandler.java:282:INFO ] This is the first request in this visit. sessionId= C458AFF4A31D8B54E2F7E547FC4DF4 BA.jvm1
2017-02-27 17:50:29,607 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# check509CertLogin] from [preprocessor], result is [success]
2017-02-27 17:50:29,608 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkRequestHeaderLogin] from [preprocessor], result is [success]
2017-02-27 17:50:29,608 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkServletRequestRemoteUserL ogin] from [preprocessor], result is [success]
2017-02-27 17:50:29,609 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkExternalLoginKey] from [preprocessor], result is [success]
2017-02-27 17:50:29,610 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.ProtectViewWorker# checkProtectedView] from [preprocessor], result is [success]
2017-02-27 17:50:29,623 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [soap:#] from [request], result is [null]
2017-02-27 17:50:29,624 (http-0.0.0.0-443-10) [       ServerHitBin.java:628:INFO ] Visit delegatorName=default, ServerHitBin delegatorName=default
2017-02-27 17:50:29,658 (http-0.0.0.0-443-10) [       ServerHitBin.java:722:INFO ] Duplicate ServerHit was updated: [GenericEntity:ServerHit][ contentId,webtools. SOAPService(java.lang.String)] [createdStamp,2017-02-27 17:50:29.628(java.sql. Timestamp)][createdTxStamp, 2017-02-27 17:50:29.625(java.sql. Timestamp)][hitStartDateTime, 2017-02-27 17:50:29.464(java.sql. Timestamp)][hitTypeId,REQUEST( java.lang.String)][ lastUpdatedStamp,2017-02-27 17:50:29.628(java.sql. Timestamp)][ lastUpdatedTxStamp,2017-02-27 17:50:29.625(java.sql. Timestamp)][referrerUrl,(java. lang.String)][requestUrl,https ://107.180.69.62/webtools/ control/SOAPService/testSoap? WSDL(java.lang.String)][ runningTimeMillis,160(java. lang.Long)][serverHostName, s107-180-69-62.secureserver. net(java.lang.String)][ serverIpAddress,107.180.69.62( java.lang.String)][visitId, 11054(java.lang.String)]
2017-02-27 17:50:29,658 (http-0.0.0.0-443-10) [     ControlServlet.java:328:INFO ] [[[SOAPService] Request Done- total:0.194,since last([SOAPService] Req...):0.194]]
2017-02-27 17:50:31,362 (http-0.0.0.0-443-10) [ControlEventListener.java:65 :INFO ] Creating session: D5C0BEB00515DC3D18C765C9D85D18 34.jvm1
2017-02-27 17:50:31,362 (http-0.0.0.0-443-10) [      ContextFilter.java:202:INFO ] [Request]: /webtools/control/SOAPService
2017-02-27 17:50:31,364 (http-0.0.0.0-443-10) [     ControlServlet.java:145:INFO ] [[[SOAPService] Request Begun, encoding=[utf-8]- total:0.0,since last(Begin):0.0]]
2017-02-27 17:50:31,365 (http-0.0.0.0-443-10) [       VisitHandler.java:233:INFO ] Found visitorId [null] in cookie
2017-02-27 17:50:31,458 (http-0.0.0.0-443-10) [     RequestHandler.java:282:INFO ] This is the first request in this visit. sessionId= D5C0BEB00515DC3D18C765C9D85D18 34.jvm1
2017-02-27 17:50:31,459 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# check509CertLogin] from [preprocessor], result is [success]
2017-02-27 17:50:31,460 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkRequestHeaderLogin] from [preprocessor], result is [success]
2017-02-27 17:50:31,461 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkServletRequestRemoteUserL ogin] from [preprocessor], result is [success]
2017-02-27 17:50:31,461 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkExternalLoginKey] from [preprocessor], result is [success]
2017-02-27 17:50:31,462 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.ProtectViewWorker# checkProtectedView] from [preprocessor], result is [success]
2017-02-27 17:50:31,473 (http-0.0.0.0-443-10) [   SOAPEventHandler.java:160:INFO ] Request Message:
<?xml version="1.0" encoding="utf-8"?><env: Envelope xmlns:env="http://www.w3.org/ 2003/05/soap-envelope" xmlns:ns1="http://ofbiz. apache.org/service/"><env: Body><ns1:testSoap><map-Map>< map-Entry></map-Entry><map- Entry></map-Entry><map-Entry>< /map-Entry><map-Entry></map- Entry><map-Entry></map-Entry>< map-Entry></map-Entry><map- Entry></map-Entry></map-Map></ ns1:testSoap></env:Body></env: Envelope>

2017-02-27 17:50:31,486 (http-0.0.0.0-443-10) [   SOAPEventHandler.java:261:INFO ] Response Message:
<?xml version="1.0" encoding="utf-8"?><soapenv: Envelope xmlns:soapenv="http://schemas. xmlsoap.org/soap/envelope/">< soapenv:Body><Response><map- Map>
        <map-Entry>
            <map-Key>
                <std-String value="errorMessage"></std- String>
            </map-Key>
            <map-Value>
                <null></null>
            </map-Value>
        </map-Entry>
    </map-Map></Response></ soapenv:Body></soapenv: Envelope>

2017-02-27 17:50:31,488 (http-0.0.0.0-443-10) [     RequestHandler.java:421:ERROR] Request SOAPService caused an error with the following message: Error calling event: org.ofbiz.webapp.event. EventHandlerException
2017-02-27 17:50:31,488 (http-0.0.0.0-443-10) [       ServerHitBin.java:628:INFO ] Visit delegatorName=default, ServerHitBin delegatorName=default
2017-02-27 17:50:31,530 (http-0.0.0.0-443-10) [       ServerHitBin.java:722:INFO ] Duplicate ServerHit was updated: [GenericEntity:ServerHit][ contentId,webtools. SOAPService(java.lang.String)] [createdStamp,2017-02-27 17:50:31.492(java.sql. Timestamp)][createdTxStamp, 2017-02-27 17:50:31.489(java.sql. Timestamp)][hitStartDateTime, 2017-02-27 17:50:31.364(java.sql. Timestamp)][hitTypeId,REQUEST( java.lang.String)][ lastUpdatedStamp,2017-02-27 17:50:31.492(java.sql. Timestamp)][ lastUpdatedTxStamp,2017-02-27 17:50:31.489(java.sql. Timestamp)][referrerUrl,(java. lang.String)][requestUrl,https ://107.180.69.62/webtools/ control/SOAPService(java.lang. String)][runningTimeMillis, 124(java.lang.Long)][ serverHostName,s107-180-69-62. secureserver.net(java.lang. String)][serverIpAddress,107. 180.69.62(java.lang.String)][ visitId,11055(java.lang. String)]
2017-02-27 17:50:31,530 (http-0.0.0.0-443-10) [     ControlServlet.java:328:INFO ] [[[SOAPService] Request Done- total:0.166,since last([SOAPService] Req...):0.166]]





--
Coherent Software Australia Pty Ltd
PO Box 2773
Cheltenham Vic 3192Australia
Phone: +61 3 9585 6788
Web: http://www.coherentsoftware.com.au/
Email: [hidden email]


   
Reply | Threaded
Open this post in threaded view
|

Re: Problem consuming ofbiz soap services from PHP

Alfonso Barreto
Shi, many thanks, excelent idea, will explore than option.
Best regards


      From: Shi Jinghai <[hidden email]>
 To: "[hidden email]" <[hidden email]>
 Sent: Tuesday, February 28, 2017 12:32 AM
 Subject: Re: Problem consuming ofbiz soap services from PHP
   
Hi Alfonso,

Perhaps you can try axis2 directly to see whether it's worked well. If yes, you can add axis2 to OFBiz as a plugin.

I built an axis2 component several years ago, I'm not sure whether I can find it.

Kind Regards,

Shi Jinghai

-----邮件原件-----
发件人: Alfonso Barreto [mailto:[hidden email]]
发送时间: 2017年2月28日 8:54
收件人: Paul Foxworthy; [hidden email]
主题: Re: Problem consuming ofbiz soap services from PHP

Thanks Paul, I tryed that syntax too, but apparently the one that works better is the one I show, with the one you say it generates an exception on the client side, just after sending.

      From: Paul Foxworthy <[hidden email]>
 To: [hidden email]; Alfonso Barreto <[hidden email]>
 Sent: Monday, February 27, 2017 6:51 PM
 Subject: Re: Problem consuming ofbiz soap services from PHP
 
Hi Alfonso,
The log suggests to me that the parameters are not being *sent*: OFBiz is just receiving an empty map:
<map-Map><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry><map-Entry></map-Entry></map-Map>

A map entry has a key and a value. Try using the PHP syntax to create an associative array:
array(    key  => value,    key2 => value2,    key3 => value3,    ...); You could try using something to see the exact SOAP message before OFBiz processes it, perhaps SoapUI (soapui.org).
Hope that helps.
Paul Foxworthy

On 28 February 2017 at 10:52, Alfonso Barreto <[hidden email]> wrote:

Been trying to find and updated reference for this, but still haven't found it.
I try to consume the soap  testing services that comes on ofbiz, but for some reason, the parameters are not readed on the server part. This is the code Iam using on PHP, tryed several combinations but cant find the rigth one. Will appreciate some help.



            ini_set('soap. wsdl_cache_enabled', 0);
            ini_set('soap.wsdl_cache_ttl', 900);
            ini_set('default_socket_ timeout', 15);

       
            //$wsdl = 'https://107.180.69.62/ webtools/control/SOAPService/ getProductInventoryAvailable? WSDL';
            //$wsdl = 'https://107.180.69.62/ webtools/control/SOAPService/ testRemoteSoap?WSDL';
            //$wsdl = 'https://107.180.69.62/ webtools/control/SOAPService/ testRemoteSoap1?WSDL';
            //$wsdl = 'https://107.180.69.62/ webtools/control/SOAPService/ testSoapSimple?WSDL';
            $wsdl = 'https://107.180.69.62/ webtools/control/SOAPService/ testSoap?WSDL';
            $wsdl = 'https://107.180.69.62/ product/control/ soapGetProductNames/ soapWebService?WSDL';
            $data=null;
            $options = array(
        //'style'=>SOAP_RPC,
        //'use'=>SOAP_ENCODED,
        'soap_version'=>SOAP_1_2,
        //'cache_wsdl'=>WSDL_CACHE_ NONE,
        'connection_timeout'=>15,
        'trace'=>true,
        'encoding'=>'UTF-8',
        'exceptions'=>true,
                );
            try {
                $soap = new SoapClient($wsdl,$options);
                //$soap->__soapCall('lupe',' lupe','lupe1234','es',null, testSoapSimple', array($params));
                //$data = $soap->testSoapSimple(array(' lupe','lupe','lupe1234','es', null,34.5,'testPrueba')); //$params);
                //$data = $soap->testSoap(array('lupe',' lupe','lupe1234','es',null,34. 5,'testPrueba'));
                //$data = $soap->testRemoteSoap(array( 34.6,'Prueba2Test','lupe',' lupe1234'));
                //$data = $soap->testRemoteSoap1(array(' 56789','LatLonListZipCode'));
                $data = $soap->soapWebService(array(' prueba'));
            }
            catch(Exception $e) {
                print $e->getMessage();
            }
 
            var_dump($data);


In any combination I use, this is the log I get on the server:
2017-02-27 17:49:38,757 (http-0.0.0.0-443-10) [       VisitHandler.java:233:INFO ] Found visitorId [null] in cookie
2017-02-27 17:49:38,840 (http-0.0.0.0-443-10) [     RequestHandler.java:282:INFO ] This is the first request in this visit. sessionId= A41F2EF98F6C29894283AB3FAE4F73 9B.jvm1
2017-02-27 17:49:38,841 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# check509CertLogin] from [preprocessor], result is [success]
2017-02-27 17:49:38,842 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkRequestHeaderLogin] from [preprocessor], result is [success]
2017-02-27 17:49:38,842 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkServletRequestRemoteUserL ogin] from [preprocessor], result is [success]
2017-02-27 17:49:38,843 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkExternalLoginKey] from [preprocessor], result is [success]
2017-02-27 17:49:38,844 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.ProtectViewWorker# checkProtectedView] from [preprocessor], result is [success]
2017-02-27 17:49:38,880 (http-0.0.0.0-443-10) [   SOAPEventHandler.java:160:INFO ] Request Message:
<?xml version="1.0" encoding="utf-8"?><env: Envelope xmlns:env="http://www.w3.org/ 2003/05/soap-envelope" xmlns:ns1="http://ofbiz. apache.org/service/"><env: Body><ns1:testSoap><map-Map>< map-Entry></map-Entry><map- Entry></map-Entry><map-Entry>< /map-Entry><map-Entry></map- Entry><map-Entry></map-Entry>< map-Entry></map-Entry><map- Entry></map-Entry></map-Map></ ns1:testSoap></env:Body></env: Envelope>

2017-02-27 17:49:38,897 (http-0.0.0.0-443-10) [   SOAPEventHandler.java:261:INFO ] Response Message:
<?xml version="1.0" encoding="utf-8"?><soapenv: Envelope xmlns:soapenv="http://schemas. xmlsoap.org/soap/envelope/">< soapenv:Body><Response><map- Map>
        <map-Entry>
            <map-Key>
                <std-String value="errorMessage"></std- String>
            </map-Key>
            <map-Value>
                <null></null>
            </map-Value>
        </map-Entry>
    </map-Map></Response></ soapenv:Body></soapenv: Envelope>

2017-02-27 17:49:38,899 (http-0.0.0.0-443-10) [     RequestHandler.java:421:ERROR] Request SOAPService caused an error with the following message: Error calling event: org.ofbiz.webapp.event. EventHandlerException
2017-02-27 17:49:38,900 (http-0.0.0.0-443-10) [       ServerHitBin.java:628:INFO ] Visit delegatorName=default, ServerHitBin delegatorName=default
2017-02-27 17:49:38,934 (http-0.0.0.0-443-10) [       ServerHitBin.java:722:INFO ] Duplicate ServerHit was updated: [GenericEntity:ServerHit][ contentId,webtools. SOAPService(java.lang.String)] [createdStamp,2017-02-27 17:49:38.903(java.sql. Timestamp)][createdTxStamp, 2017-02-27 17:49:38.9(java.sql.Timestamp) ][hitStartDateTime,2017-02-27 17:49:38.756(java.sql. Timestamp)][hitTypeId,REQUEST( java.lang.String)][ lastUpdatedStamp,2017-02-27 17:49:38.903(java.sql. Timestamp)][ lastUpdatedTxStamp,2017-02-27 17:49:38.9(java.sql.Timestamp) ][referrerUrl,(java.lang. String)][requestUrl,https:// 107.180.69.62/webtools/ control/SOAPService(java.lang. String)][runningTimeMillis, 143(java.lang.Long)][ serverHostName,s107-180-69-62. secureserver.net(java.lang. String)][serverIpAddress,107. 180.69.62(java.lang.String)][ visitId,11053(java.lang. String)]
2017-02-27 17:49:38,935 (http-0.0.0.0-443-10) [     ControlServlet.java:328:INFO ] [[[SOAPService] Request Done- total:0.177,since last([SOAPService] Req...):0.177]]
2017-02-27 17:50:29,461 (http-0.0.0.0-443-10) [ControlEventListener.java:65 :INFO ] Creating session: C458AFF4A31D8B54E2F7E547FC4DF4 BA.jvm1
2017-02-27 17:50:29,462 (http-0.0.0.0-443-10) [      ContextFilter.java:202:INFO ] [Request]: /webtools/control/SOAPService/ testSoap
2017-02-27 17:50:29,464 (http-0.0.0.0-443-10) [     ControlServlet.java:145:INFO ] [[[SOAPService] Request Begun, encoding=[UTF-8]- total:0.0,since last(Begin):0.0]]
2017-02-27 17:50:29,464 (http-0.0.0.0-443-10) [       VisitHandler.java:233:INFO ] Found visitorId [null] in cookie
2017-02-27 17:50:29,599 (http-0.0.0.0-443-10) [    ConfigXMLReader.java:184:INFO ] controller loaded: 0.0s, 23 requests, 16 views in file:/mnt/opentaps-1.5.0/ framework/common/webcommon/ WEB-INF/common-controller.xml
2017-02-27 17:50:29,602 (http-0.0.0.0-443-10) [    ConfigXMLReader.java:184:INFO ] controller loaded: 0.0s, 5 requests, 0 views in file:/mnt/opentaps-1.5.0/ framework/common/webcommon/ WEB-INF/tempexpr-controller. xml
2017-02-27 17:50:29,605 (http-0.0.0.0-443-10) [    ConfigXMLReader.java:184:INFO ] controller loaded: 0.0s, 8 requests, 2 views in file:/mnt/opentaps-1.5.0/ framework/testtools/webapp/ testtools/WEB-INF/controller. xml
2017-02-27 17:50:29,606 (http-0.0.0.0-443-10) [    ConfigXMLReader.java:184:INFO ] controller loaded: 0.01s, 110 requests, 64 views in file:/mnt/opentaps-1.5.0/ framework/webtools/webapp/ webtools/WEB-INF/controller. xml
2017-02-27 17:50:29,606 (http-0.0.0.0-443-10) [     RequestHandler.java:282:INFO ] This is the first request in this visit. sessionId= C458AFF4A31D8B54E2F7E547FC4DF4 BA.jvm1
2017-02-27 17:50:29,607 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# check509CertLogin] from [preprocessor], result is [success]
2017-02-27 17:50:29,608 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkRequestHeaderLogin] from [preprocessor], result is [success]
2017-02-27 17:50:29,608 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkServletRequestRemoteUserL ogin] from [preprocessor], result is [success]
2017-02-27 17:50:29,609 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkExternalLoginKey] from [preprocessor], result is [success]
2017-02-27 17:50:29,610 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.ProtectViewWorker# checkProtectedView] from [preprocessor], result is [success]
2017-02-27 17:50:29,623 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [soap:#] from [request], result is [null]
2017-02-27 17:50:29,624 (http-0.0.0.0-443-10) [       ServerHitBin.java:628:INFO ] Visit delegatorName=default, ServerHitBin delegatorName=default
2017-02-27 17:50:29,658 (http-0.0.0.0-443-10) [       ServerHitBin.java:722:INFO ] Duplicate ServerHit was updated: [GenericEntity:ServerHit][ contentId,webtools. SOAPService(java.lang.String)] [createdStamp,2017-02-27 17:50:29.628(java.sql. Timestamp)][createdTxStamp, 2017-02-27 17:50:29.625(java.sql. Timestamp)][hitStartDateTime, 2017-02-27 17:50:29.464(java.sql. Timestamp)][hitTypeId,REQUEST( java.lang.String)][ lastUpdatedStamp,2017-02-27 17:50:29.628(java.sql. Timestamp)][ lastUpdatedTxStamp,2017-02-27 17:50:29.625(java.sql. Timestamp)][referrerUrl,(java. lang.String)][requestUrl,https ://107.180.69.62/webtools/ control/SOAPService/testSoap? WSDL(java.lang.String)][ runningTimeMillis,160(java. lang.Long)][serverHostName, s107-180-69-62.secureserver. net(java.lang.String)][ serverIpAddress,107.180.69.62( java.lang.String)][visitId, 11054(java.lang.String)]
2017-02-27 17:50:29,658 (http-0.0.0.0-443-10) [     ControlServlet.java:328:INFO ] [[[SOAPService] Request Done- total:0.194,since last([SOAPService] Req...):0.194]]
2017-02-27 17:50:31,362 (http-0.0.0.0-443-10) [ControlEventListener.java:65 :INFO ] Creating session: D5C0BEB00515DC3D18C765C9D85D18 34.jvm1
2017-02-27 17:50:31,362 (http-0.0.0.0-443-10) [      ContextFilter.java:202:INFO ] [Request]: /webtools/control/SOAPService
2017-02-27 17:50:31,364 (http-0.0.0.0-443-10) [     ControlServlet.java:145:INFO ] [[[SOAPService] Request Begun, encoding=[utf-8]- total:0.0,since last(Begin):0.0]]
2017-02-27 17:50:31,365 (http-0.0.0.0-443-10) [       VisitHandler.java:233:INFO ] Found visitorId [null] in cookie
2017-02-27 17:50:31,458 (http-0.0.0.0-443-10) [     RequestHandler.java:282:INFO ] This is the first request in this visit. sessionId= D5C0BEB00515DC3D18C765C9D85D18 34.jvm1
2017-02-27 17:50:31,459 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# check509CertLogin] from [preprocessor], result is [success]
2017-02-27 17:50:31,460 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkRequestHeaderLogin] from [preprocessor], result is [success]
2017-02-27 17:50:31,461 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkServletRequestRemoteUserL ogin] from [preprocessor], result is [success]
2017-02-27 17:50:31,461 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.LoginWorker# checkExternalLoginKey] from [preprocessor], result is [success]
2017-02-27 17:50:31,462 (http-0.0.0.0-443-10) [     RequestHandler.java:641:INFO ] Ran Event [java:org.ofbiz.webapp. control.ProtectViewWorker# checkProtectedView] from [preprocessor], result is [success]
2017-02-27 17:50:31,473 (http-0.0.0.0-443-10) [   SOAPEventHandler.java:160:INFO ] Request Message:
<?xml version="1.0" encoding="utf-8"?><env: Envelope xmlns:env="http://www.w3.org/ 2003/05/soap-envelope" xmlns:ns1="http://ofbiz. apache.org/service/"><env: Body><ns1:testSoap><map-Map>< map-Entry></map-Entry><map- Entry></map-Entry><map-Entry>< /map-Entry><map-Entry></map- Entry><map-Entry></map-Entry>< map-Entry></map-Entry><map- Entry></map-Entry></map-Map></ ns1:testSoap></env:Body></env: Envelope>

2017-02-27 17:50:31,486 (http-0.0.0.0-443-10) [   SOAPEventHandler.java:261:INFO ] Response Message:
<?xml version="1.0" encoding="utf-8"?><soapenv: Envelope xmlns:soapenv="http://schemas. xmlsoap.org/soap/envelope/">< soapenv:Body><Response><map- Map>
        <map-Entry>
            <map-Key>
                <std-String value="errorMessage"></std- String>
            </map-Key>
            <map-Value>
                <null></null>
            </map-Value>
        </map-Entry>
    </map-Map></Response></ soapenv:Body></soapenv: Envelope>

2017-02-27 17:50:31,488 (http-0.0.0.0-443-10) [     RequestHandler.java:421:ERROR] Request SOAPService caused an error with the following message: Error calling event: org.ofbiz.webapp.event. EventHandlerException
2017-02-27 17:50:31,488 (http-0.0.0.0-443-10) [       ServerHitBin.java:628:INFO ] Visit delegatorName=default, ServerHitBin delegatorName=default
2017-02-27 17:50:31,530 (http-0.0.0.0-443-10) [       ServerHitBin.java:722:INFO ] Duplicate ServerHit was updated: [GenericEntity:ServerHit][ contentId,webtools. SOAPService(java.lang.String)] [createdStamp,2017-02-27 17:50:31.492(java.sql. Timestamp)][createdTxStamp, 2017-02-27 17:50:31.489(java.sql. Timestamp)][hitStartDateTime, 2017-02-27 17:50:31.364(java.sql. Timestamp)][hitTypeId,REQUEST( java.lang.String)][ lastUpdatedStamp,2017-02-27 17:50:31.492(java.sql. Timestamp)][ lastUpdatedTxStamp,2017-02-27 17:50:31.489(java.sql. Timestamp)][referrerUrl,(java. lang.String)][requestUrl,https ://107.180.69.62/webtools/ control/SOAPService(java.lang. String)][runningTimeMillis, 124(java.lang.Long)][ serverHostName,s107-180-69-62. secureserver.net(java.lang. String)][serverIpAddress,107. 180.69.62(java.lang.String)][ visitId,11055(java.lang. String)]
2017-02-27 17:50:31,530 (http-0.0.0.0-443-10) [     ControlServlet.java:328:INFO ] [[[SOAPService] Request Done- total:0.166,since last([SOAPService] Req...):0.166]]





--
Coherent Software Australia Pty Ltd
PO Box 2773
Cheltenham Vic 3192Australia
Phone: +61 3 9585 6788
Web: http://www.coherentsoftware.com.au/
Email: [hidden email]


 


   
12