You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Parm Lehal <pa...@gmail.com> on 2012/09/13 00:50:59 UTC
SOAP service in ofbiz fails
I am trying use web-service using netbeans. The JAX-WS SOAP service fails
with this error :
javax.xml.ws.WebServiceException: Unexpected response element Response
expected: {http://ofbiz.apache.org/service/}createProductResponse
at
com.sun.xml.internal.ws.client.sei.ResponseBuilder$RpcLit.readResponse(ResponseBuilder.java:603)
at
com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:110)
at
com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
at $Proxy28.createProduct(Unknown Source)
However, if I use xmlrpc, it works fine. Is there any trick in making
JAX-WS web service work or am I missing something? Please, advise.
Regards,
Parminder Lehal
Re: SOAP service in ofbiz fails
Posted by Jacques Le Roux <ja...@les7arts.com>.
OK I reproduced on trunk demo using http://demo-trunk.ofbiz.apache.org:8080/webtools/control/SOAPService to avoid SSL issue
The server I used yesterday was not updated and it seems that fixing the WSDL generator had an impact on the XmlSerializer.java
I will have a look...
Jacques
From: "Parminder Lehal" <PL...@fiskerautomotive.com>
>I downloaded the latest trunk from SVN and built the jax-ws client using Netbeans for ping service.
>
> Here is the server log:
>
>
> [java] 2012-09-13 14:14:51,495 (http-bio-0.0.0.0-8080-exec-7) [ControlEventListener.java:65 :INFO ] Creating session:
> B648AA02665EE4960C6DF4A1443B1DD1.jvm1
> [java] 2012-09-13 14:14:51,496 (http-bio-0.0.0.0-8080-exec-7) [ ContextFilter.java:193:INFO ] [Domain]: localhost
> [Request]: /webtools/control/SOAPService
> [java] 2012-09-13 14:14:51,496 (http-bio-0.0.0.0-8080-exec-7) [ ControlServlet.java:140:INFO ]
> [[[SOAPService(Domain:http://localhost)] Request Begun, encoding=[utf-8]- total:0.0,since last(Begin):0.0]]
> [java] 2012-09-13 14:14:51,496 (http-bio-0.0.0.0-8080-exec-7) [ VisitHandler.java:232:INFO ] Found visitorId [null] in
> cookie
> [java] 2012-09-13 14:14:51,507 (http-bio-0.0.0.0-8080-exec-7) [ ConfigXMLReader.java:115:INFO ] controller loaded: 0.002s,
> 113 requests, 70 views in jndi:/0.0.0.0/webtools/WEB-INF/controller.xml
> [java] 2012-09-13 14:14:51,511 (http-bio-0.0.0.0-8080-exec-7) [ ConfigXMLReader.java:115:INFO ] controller loaded: 0.0s, 36
> requests, 19 views in file:/home/plehal/ofbiz/framework/common/webcommon/WEB-INF/common-controller.xml
> [java] 2012-09-13 14:14:51,515 (http-bio-0.0.0.0-8080-exec-7) [ ConfigXMLReader.java:115:INFO ] controller loaded: 0.0s, 25
> requests, 10 views in file:/home/plehal/ofbiz/framework/common/webcommon/WEB-INF/portal-controller.xml
> [java] 2012-09-13 14:14:51,519 (http-bio-0.0.0.0-8080-exec-7) [ ConfigXMLReader.java:115:INFO ] controller loaded: 0.0s, 30
> requests, 13 views in file:/home/plehal/ofbiz/framework/common/webcommon/WEB-INF/security-controller.xml
> [java] 2012-09-13 14:14:51,522 (http-bio-0.0.0.0-8080-exec-7) [ ConfigXMLReader.java:115:INFO ] controller loaded: 0.0s, 5
> requests, 0 views in file:/home/plehal/ofbiz/framework/common/webcommon/WEB-INF/tempexpr-controller.xml
> [java] 2012-09-13 14:14:51,523 (http-bio-0.0.0.0-8080-exec-7) [ RequestHandler.java:299:INFO ] This is the first request
> in this visit. sessionId=B648AA02665EE4960C6DF4A1443B1DD1.jvm1
> [java] 2012-09-13 14:14:51,561 (http-bio-0.0.0.0-8080-exec-7) [ SOAPEventHandler.java:214:ERROR]
> [java] ---- runtime exception report --------------------------------------------------
> [java] Exception: java.lang.NullPointerException
> [java] Message: null
> [java] ---- stack trace ---------------------------------------------------------------
> [java] java.lang.NullPointerException
> [java] org.ofbiz.entity.serialize.XmlSerializer.deserializeSingle(XmlSerializer.java:424)
> [java] org.ofbiz.entity.serialize.XmlSerializer.deserialize(XmlSerializer.java:128)
> [java] org.ofbiz.service.engine.SoapSerializer.deserialize(SoapSerializer.java:45)
> [java] org.ofbiz.webapp.event.SOAPEventHandler.invoke(SOAPEventHandler.java:177)
> [java] org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:666)
> [java] org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:409)
> [java] org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:214)
> [java] org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:86)
> [java] javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
> [java] javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
> [java] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
> [java] org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> [java] org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:318)
> [java] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> [java] org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> [java] org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
> [java] org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
> [java] org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
> [java] org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
> [java] org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
> [java] org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
> [java] org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
> [java] org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
> [java] org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
> [java] org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
> [java] org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
> [java] java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> [java] java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> [java] java.lang.Thread.run(Thread.java:636)
> [java] --------------------------------------------------------------------------------
> [java]
> [java] 2012-09-13 14:14:51,561 (http-bio-0.0.0.0-8080-exec-7) [ RequestHandler.java:667:INFO ] Ran Event [soap:#] from
> [request], result is [null]
> [java] 2012-09-13 14:14:51,562 (http-bio-0.0.0.0-8080-exec-7) [ ServerHitBin.java:637:INFO ] Visit
> delegatorName=default, ServerHitBin delegatorName=default
> [java] 2012-09-13 14:14:51,563 (http-bio-0.0.0.0-8080-exec-7) [ ControlServlet.java:321:INFO ]
> [[[SOAPService(Domain:http://localhost)] Request Done- total:0.067,since last([SOAPService(Doma...):0.067]]
>
>
>
> Regards,
>
>
>
>
> Parminder Lehal
> PDM Interface Analyst
> Tel: +1 714-888-4255
> mailto:PLehal.aerotek@fiskerautomotive.com
> www.fiskerautomotive.com
>
> NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged
> information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please
> contact the sender by reply email and destroy all copies of the original message.
>
> Please consider your environmental responsibility before printing this e-mail.
>
> -----Original Message-----
> From: Jacques Le Roux [mailto:jacques.le.roux@les7arts.com]
> Sent: Thursday, September 13, 2012 2:48 AM
> To: user@ofbiz.apache.org
> Subject: Re: SOAP service in ofbiz fails
>
> OK, I fixed the nillable issue at r1384251
> -----------------message truncated------------------
>
RE: SOAP service in ofbiz fails
Posted by Parminder Lehal <PL...@fiskerautomotive.com>.
I downloaded the latest trunk from SVN and built the jax-ws client using Netbeans for ping service.
Here is the server log:
[java] 2012-09-13 14:14:51,495 (http-bio-0.0.0.0-8080-exec-7) [ControlEventListener.java:65 :INFO ] Creating session: B648AA02665EE4960C6DF4A1443B1DD1.jvm1
[java] 2012-09-13 14:14:51,496 (http-bio-0.0.0.0-8080-exec-7) [ ContextFilter.java:193:INFO ] [Domain]: localhost [Request]: /webtools/control/SOAPService
[java] 2012-09-13 14:14:51,496 (http-bio-0.0.0.0-8080-exec-7) [ ControlServlet.java:140:INFO ] [[[SOAPService(Domain:http://localhost)] Request Begun, encoding=[utf-8]- total:0.0,since last(Begin):0.0]]
[java] 2012-09-13 14:14:51,496 (http-bio-0.0.0.0-8080-exec-7) [ VisitHandler.java:232:INFO ] Found visitorId [null] in cookie
[java] 2012-09-13 14:14:51,507 (http-bio-0.0.0.0-8080-exec-7) [ ConfigXMLReader.java:115:INFO ] controller loaded: 0.002s, 113 requests, 70 views in jndi:/0.0.0.0/webtools/WEB-INF/controller.xml
[java] 2012-09-13 14:14:51,511 (http-bio-0.0.0.0-8080-exec-7) [ ConfigXMLReader.java:115:INFO ] controller loaded: 0.0s, 36 requests, 19 views in file:/home/plehal/ofbiz/framework/common/webcommon/WEB-INF/common-controller.xml
[java] 2012-09-13 14:14:51,515 (http-bio-0.0.0.0-8080-exec-7) [ ConfigXMLReader.java:115:INFO ] controller loaded: 0.0s, 25 requests, 10 views in file:/home/plehal/ofbiz/framework/common/webcommon/WEB-INF/portal-controller.xml
[java] 2012-09-13 14:14:51,519 (http-bio-0.0.0.0-8080-exec-7) [ ConfigXMLReader.java:115:INFO ] controller loaded: 0.0s, 30 requests, 13 views in file:/home/plehal/ofbiz/framework/common/webcommon/WEB-INF/security-controller.xml
[java] 2012-09-13 14:14:51,522 (http-bio-0.0.0.0-8080-exec-7) [ ConfigXMLReader.java:115:INFO ] controller loaded: 0.0s, 5 requests, 0 views in file:/home/plehal/ofbiz/framework/common/webcommon/WEB-INF/tempexpr-controller.xml
[java] 2012-09-13 14:14:51,523 (http-bio-0.0.0.0-8080-exec-7) [ RequestHandler.java:299:INFO ] This is the first request in this visit. sessionId=B648AA02665EE4960C6DF4A1443B1DD1.jvm1
[java] 2012-09-13 14:14:51,561 (http-bio-0.0.0.0-8080-exec-7) [ SOAPEventHandler.java:214:ERROR]
[java] ---- runtime exception report --------------------------------------------------
[java] Exception: java.lang.NullPointerException
[java] Message: null
[java] ---- stack trace ---------------------------------------------------------------
[java] java.lang.NullPointerException
[java] org.ofbiz.entity.serialize.XmlSerializer.deserializeSingle(XmlSerializer.java:424)
[java] org.ofbiz.entity.serialize.XmlSerializer.deserialize(XmlSerializer.java:128)
[java] org.ofbiz.service.engine.SoapSerializer.deserialize(SoapSerializer.java:45)
[java] org.ofbiz.webapp.event.SOAPEventHandler.invoke(SOAPEventHandler.java:177)
[java] org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:666)
[java] org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:409)
[java] org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:214)
[java] org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:86)
[java] javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
[java] javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
[java] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
[java] org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
[java] org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:318)
[java] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
[java] org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
[java] org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
[java] org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
[java] org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
[java] org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
[java] org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
[java] org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
[java] org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
[java] org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
[java] org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
[java] org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
[java] org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
[java] java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
[java] java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
[java] java.lang.Thread.run(Thread.java:636)
[java] --------------------------------------------------------------------------------
[java]
[java] 2012-09-13 14:14:51,561 (http-bio-0.0.0.0-8080-exec-7) [ RequestHandler.java:667:INFO ] Ran Event [soap:#] from [request], result is [null]
[java] 2012-09-13 14:14:51,562 (http-bio-0.0.0.0-8080-exec-7) [ ServerHitBin.java:637:INFO ] Visit delegatorName=default, ServerHitBin delegatorName=default
[java] 2012-09-13 14:14:51,563 (http-bio-0.0.0.0-8080-exec-7) [ ControlServlet.java:321:INFO ] [[[SOAPService(Domain:http://localhost)] Request Done- total:0.067,since last([SOAPService(Doma...):0.067]]
Regards,
Parminder Lehal
PDM Interface Analyst
Tel: +1 714-888-4255
mailto:PLehal.aerotek@fiskerautomotive.com
www.fiskerautomotive.com
NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
Please consider your environmental responsibility before printing this e-mail.
-----Original Message-----
From: Jacques Le Roux [mailto:jacques.le.roux@les7arts.com]
Sent: Thursday, September 13, 2012 2:48 AM
To: user@ofbiz.apache.org
Subject: Re: SOAP service in ofbiz fails
OK, I fixed the nillable issue at r1384251
-----------------message truncated------------------
Re: SOAP service in ofbiz fails
Posted by Jacques Le Roux <ja...@les7arts.com>.
OK, I fixed the nillable issue at r1384251
Locally I could use the ping service but got a (actually reassuring) "unable to find valid certification path to requested target"
which is caused by a self signed local certificat (or no valid certificat at all, anyway)
So I tried on a remote server and got this
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<pingResponse xmlns="http://ofbiz.apache.org/service/">
<map-Map>
<map-Entry>
<map-Key>
<std-String value="responseMessage"/>
</map-Key>
<map-Value>
<std-String value="success"/>
</map-Value>
</map-Entry>
<map-Entry>
<map-Key>
<std-String value="message"/>
</map-Key>
<map-Value>
<std-String value="PONG"/>
</map-Value>
</map-Entry>
</map-Map>
</pingResponse>
</soapenv:Body>
</soapenv:Envelope>
with your request
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
<SOAP-ENV:Body>
<jsx1:ping xmlns:jsx1="http://ofbiz.apache.org/service/" >
<map-Map>
<jsx1:map-Entry>
<jsx1:map-Key>
<jsx1:std-String value="message" />
</jsx1:map-Key>
<jsx1:map-Value>
<jsx1:null />
<jsx1:std-String value="PING_TEST_BOOYAH" />
</jsx1:map-Value>
</jsx1:map-Entry>
</map-Map>
</jsx1:ping>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Could you confirm it works for you for other services with these changes?
Thanks
Jacques
From: "Jacques Le Roux" <ja...@les7arts.com>
> There is an error in generated WSDL related to nillable, I will have a look...
>
> Thanks for report
>
> Jacques
>
> From: "Parm Lehal" <pa...@gmail.com>
>>I am trying use web-service using netbeans. The JAX-WS SOAP service fails
>> with this error :
>>
>> javax.xml.ws.WebServiceException: Unexpected response element Response
>> expected: {http://ofbiz.apache.org/service/}createProductResponse
>> at
>> com.sun.xml.internal.ws.client.sei.ResponseBuilder$RpcLit.readResponse(ResponseBuilder.java:603)
>> at
>> com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:110)
>> at
>> com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
>> at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
>> at $Proxy28.createProduct(Unknown Source)
>>
>> However, if I use xmlrpc, it works fine. Is there any trick in making
>> JAX-WS web service work or am I missing something? Please, advise.
>>
>>
>> Regards,
>>
>> Parminder Lehal
>>
Re: SOAP service in ofbiz fails
Posted by Jacques Le Roux <ja...@les7arts.com>.
There is an error in generated WSDL related to nillable, I will have a look...
Thanks for report
Jacques
From: "Parm Lehal" <pa...@gmail.com>
>I am trying use web-service using netbeans. The JAX-WS SOAP service fails
> with this error :
>
> javax.xml.ws.WebServiceException: Unexpected response element Response
> expected: {http://ofbiz.apache.org/service/}createProductResponse
> at
> com.sun.xml.internal.ws.client.sei.ResponseBuilder$RpcLit.readResponse(ResponseBuilder.java:603)
> at
> com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:110)
> at
> com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
> at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
> at $Proxy28.createProduct(Unknown Source)
>
> However, if I use xmlrpc, it works fine. Is there any trick in making
> JAX-WS web service work or am I missing something? Please, advise.
>
>
> Regards,
>
> Parminder Lehal
>