You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Jesús Fernández <je...@cim-ecm.es> on 2022/06/08 15:18:55 UTC

Enable SOAP web services

Hello everyone

I want to use SOAP web services.
I enable the services by putting export="true" in the xml of the services
that interest me, and then it is enabled to see the WSDL within the Ofbiz
web.
When I use the SoapUI for the endpoint:
"http://localhost:8080/webtools/control/SOAPService"
It gives me a 500 error and in the log "Unknown request [SOAPService]; this
request does not exist or cannot be called directly."
In the browser, the same thing happens when I call "
http://localhost:8080/webtools/control/SOAPService?wsdl"
It happens to me with 18.12 and with 20.01.
What have I forgotten to do?

Thanks in advance.

Re: Enable SOAP web services

Posted by Jesús Fernández <je...@cim-ecm.es>.
Problem solved.
In case someone else happens, I wasn't grouping key-value (map-Key &
map-Value) inside the one map-Entry node for each.

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Libre
de virus. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Re: Enable SOAP web services

Posted by Jesús Fernández <je...@cim-ecm.es>.
Thank you very much, Michael.

I have updated the following files:

   - /framework/webtools/webapp/webtools/WEB-INF/controller.xml
   - /framework/service/config/serviceengine.xml
   framework/service/config/serviceengine.xml
   - /framework/common/webcommon/WEB-INF/handlers-controller.xml

The "getAllCategories" web service works.
However "getInvoices" and "createInvoice" give an error:

   - 18.12: *org.apache.ofbiz.service.ServiceAuthException: You must be
   logged in to complete the [Accounting invoice permission logic] process.*
   - 22.01: *org.apache.ofbiz.service.ServiceAuthException: You haven't the
   permission for the service getInvoice, reason : User login is missing*

The input XML:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ser="http://ofbiz.apache.org/service/">
   <soapenv:Header/>
   <soapenv:Body>
      <ser:getInvoice>
         <map-Map>
            <ser:map-Entry>
               <ser:map-Key>
                  <ser:std-String value="login.password"/>
               </ser:map-Key>
               <ser:map-Value>
                  <ser:std-String value="admin"/>
               </ser:map-Value>
               <ser:map-Key>
                  <ser:std-String value="login.username"/>
               </ser:map-Key>
               <ser:map-Value>
                  <ser:std-String value="ofbiz"/>
               </ser:map-Value>
               <ser:map-Key>
                  <ser:std-String value="invoiceId"/>
               </ser:map-Key>
               <ser:map-Value>
                  <ser:std-String value="8010"/>
               </ser:map-Value>
            </ser:map-Entry>
         </map-Map>
      </ser:getInvoice>
   </soapenv:Body>
</soapenv:Envelope>


By the way, how could I pass an "org.apache.ofbiz.entity.GenericValue"
parameter in the XML?

Greetings.

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Libre
de virus. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Re: Enable SOAP web services

Posted by Michael Brohl <mi...@ecomify.de>.
Hi Jesús,

the SOAP client engine is disabled by default for security reasons, see 
https://lists.apache.org/thread/w9y9f72q4q2yr8hohryt7osmtx2xtpnz

You can reenable it by commenting in the engine in serviceengine.xml.

Best regards,

Michael Brohl

ecomify GmbH - www.ecomify.de


Am 08.06.22 um 17:18 schrieb Jesús Fernández:
> Hello everyone
>
> I want to use SOAP web services.
> I enable the services by putting export="true" in the xml of the services
> that interest me, and then it is enabled to see the WSDL within the Ofbiz
> web.
> When I use the SoapUI for the endpoint:
> "http://localhost:8080/webtools/control/SOAPService"
> It gives me a 500 error and in the log "Unknown request [SOAPService]; this
> request does not exist or cannot be called directly."
> In the browser, the same thing happens when I call "
> http://localhost:8080/webtools/control/SOAPService?wsdl"
> It happens to me with 18.12 and with 20.01.
> What have I forgotten to do?
>
> Thanks in advance.
>