You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Christopher Snow <sn...@snowconsulting.co.uk> on 2009/12/29 13:11:00 UTC

any wsdl/xsd experts online?

Are there any wsdl/xsd experts online who can advise on some issues I'm 
having with the latest axis2 ofbiz integration?

Many thanks in advance,

Chris

Re: any wsdl/xsd experts online?

Posted by Christopher Snow <sn...@snowconsulting.co.uk>.
The response needs to have a namespace attached:

### Eclipse Workspace Patch 1.0
#P ofbiz
Index: framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java
===================================================================
--- framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java    
(revision 894372)
+++ framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java    
(working copy)
@@ -140,6 +140,7 @@
         }
 
         // not a wsdl request; invoke the service
+        response.setContentType("text/xml");
        
         // request envelope
         SOAPEnvelope reqEnv = null;
@@ -193,7 +194,7 @@
                             SOAPFactory factory = 
OMAbstractFactory.getSOAP11Factory();
                             SOAPEnvelope resEnv = 
factory.createSOAPEnvelope();
                             SOAPBody resBody = factory.createSOAPBody();
-                            OMElement resService = 
factory.createOMElement(new QName(serviceName + "Response"));
+                            OMElement resService = 
factory.createOMElement(new QName(ModelService.TNS, serviceName + 
"Response"));
                             
resService.addChild(resultSer.getFirstElement());
                             resBody.addChild(resService);
                             resEnv.addChild(resBody);
@@ -227,6 +228,7 @@
     private void sendError(HttpServletResponse res, String 
errorMessage) throws EventHandlerException {
         try {
             // setup the response
+            res.setContentType("text/xml");
             Map<String, Object> results = FastMap.newInstance();
             results.put("errorMessage", errorMessage);
             String xmlResults= XmlSerializer.serialize(results);


Christopher Snow wrote:
> I was still getting the text/html error, so had to set the content 
> type as follows:
>
> ### Eclipse Workspace Patch 1.0
> #P ofbiz
> Index: framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java
> ===================================================================
> --- 
> framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java    
> (revision 894372)
> +++ 
> framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java    
> (working copy)
> @@ -140,6 +140,7 @@
>         }
>
>         // not a wsdl request; invoke the service
> +        response.setContentType("text/xml");
>                // request envelope
>         SOAPEnvelope reqEnv = null;
> @@ -227,6 +228,7 @@
>     private void sendError(HttpServletResponse res, String 
> errorMessage) throws EventHandlerException {
>         try {
>             // setup the response
> +            res.setContentType("text/xml");
>             Map<String, Object> results = FastMap.newInstance();
>             results.put("errorMessage", errorMessage);
>             String xmlResults= XmlSerializer.serialize(results);
>
> Now I am receiving the error:
>
> javax.xml.ws.WebServiceException: Unexpected response element 
> findPartiesByIdResponse expected: 
> {http://ofbiz.apache.org/service/}findPartiesByIdResponse
>
> Will take a look at that error shortly...
>
>
> Christopher Snow wrote:
>> Thanks Bilgin,
>>
>> Will take a look in a few hours:
>>
>> I think the following patch may be needed also:
>>
>> ### Eclipse Workspace Patch 1.0
>> #P ofbiz
>> Index: framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java
>> ===================================================================
>> --- 
>> framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java    
>> (revision 894372)
>> +++ 
>> framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java    
>> (working copy)
>> @@ -227,6 +227,7 @@
>>     private void sendError(HttpServletResponse res, String 
>> errorMessage) throws EventHandlerException {
>>         try {
>>             // setup the response
>> +            res.setContentType("text/xml");
>>             Map<String, Object> results = FastMap.newInstance();
>>             results.put("errorMessage", errorMessage);
>>             String xmlResults= XmlSerializer.serialize(results);
>>
>> Cheers,
>>
>> Chris
>>
>


-- 
Chris Snow - CEng MBCS CITP MBA (Tech Mgmt) (Open) CISSP

Tel: 01453 890660
Mob: 07944 880950
Www: www.snowconsulting.co.uk


Re: any wsdl/xsd experts online?

Posted by Christopher Snow <sn...@snowconsulting.co.uk>.
I was still getting the text/html error, so had to set the content type 
as follows:

### Eclipse Workspace Patch 1.0
#P ofbiz
Index: framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java
===================================================================
--- framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java    
(revision 894372)
+++ framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java    
(working copy)
@@ -140,6 +140,7 @@
         }
 
         // not a wsdl request; invoke the service
+        response.setContentType("text/xml");
        
         // request envelope
         SOAPEnvelope reqEnv = null;
@@ -227,6 +228,7 @@
     private void sendError(HttpServletResponse res, String 
errorMessage) throws EventHandlerException {
         try {
             // setup the response
+            res.setContentType("text/xml");
             Map<String, Object> results = FastMap.newInstance();
             results.put("errorMessage", errorMessage);
             String xmlResults= XmlSerializer.serialize(results);

Now I am receiving the error:

javax.xml.ws.WebServiceException: Unexpected response element 
findPartiesByIdResponse expected: 
{http://ofbiz.apache.org/service/}findPartiesByIdResponse

Will take a look at that error shortly...


Christopher Snow wrote:
> Thanks Bilgin,
>
> Will take a look in a few hours:
>
> I think the following patch may be needed also:
>
> ### Eclipse Workspace Patch 1.0
> #P ofbiz
> Index: framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java
> ===================================================================
> --- 
> framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java    
> (revision 894372)
> +++ 
> framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java    
> (working copy)
> @@ -227,6 +227,7 @@
>     private void sendError(HttpServletResponse res, String 
> errorMessage) throws EventHandlerException {
>         try {
>             // setup the response
> +            res.setContentType("text/xml");
>             Map<String, Object> results = FastMap.newInstance();
>             results.put("errorMessage", errorMessage);
>             String xmlResults= XmlSerializer.serialize(results);
>
> Cheers,
>
> Chris
>


Re: any wsdl/xsd experts online?

Posted by Christopher Snow <sn...@snowconsulting.co.uk>.
Thanks Bilgin,

Will take a look in a few hours:

I think the following patch may be needed also:

### Eclipse Workspace Patch 1.0
#P ofbiz
Index: framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java
===================================================================
--- framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java    
(revision 894372)
+++ framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java    
(working copy)
@@ -227,6 +227,7 @@
     private void sendError(HttpServletResponse res, String 
errorMessage) throws EventHandlerException {
         try {
             // setup the response
+            res.setContentType("text/xml");
             Map<String, Object> results = FastMap.newInstance();
             results.put("errorMessage", errorMessage);
             String xmlResults= XmlSerializer.serialize(results);

Cheers,

Chris

Bilgin Ibryam wrote:
> Christopher Snow wrote:
>> Hi Hans,
>>
>> I've been looking through the code and it looks like a nice job.  I 
>> am struggling with a couple of issues though:
>>
>> 1) The generated wsdl  causes tools (e.g. wsdl2java) to put a 
>> namespace prefix on the children of map-Map.  Unfortunately, the 
>> SOAPEventHandler and XmlSerializer.derserialize method don't appear 
>> to be able to handle the elements with a namespace prefix.
>>
> Chris, I have just committed a fix for this issue in r894359 to ofbiz 
> trunk. Now the namespace are handled fine.
>
>
>> 2) Because the passed in parameters are not recognized, I am 
>> receiving service errors.  However, the response appears to have 
>> multiple error messages and not follow the <ServiceName>Response 
>> pattern -  I.e. the error response is just <Response>
>>
> I didn't notice that. I will take a look soon.
> Bilgin
>> I have documented these issues in: OFBIZ-3385  - I'm currently 
>> looking though the code to try and find a resolution, although I 
>> think the first issue may need a change in the way the wsdl is 
>> generated.
>>
>> Many thanks,
>>
>> Chris
>


-- 
Chris Snow - CEng MBCS CITP MBA (Tech Mgmt) (Open) CISSP

Tel: 01453 890660
Mob: 07944 880950
Www: www.snowconsulting.co.uk


Re: any wsdl/xsd experts online?

Posted by Christopher Snow <sn...@snowconsulting.co.uk>.
Hi Bilgin,

I have attached a patch to OFBIZ-3385 to resolve some other issues that 
I had experienced.

Many thanks,

Chris

Bilgin Ibryam wrote:
> Christopher Snow wrote:
>> Hi Hans,
>>
>> I've been looking through the code and it looks like a nice job.  I 
>> am struggling with a couple of issues though:
>>
>> 1) The generated wsdl  causes tools (e.g. wsdl2java) to put a 
>> namespace prefix on the children of map-Map.  Unfortunately, the 
>> SOAPEventHandler and XmlSerializer.derserialize method don't appear 
>> to be able to handle the elements with a namespace prefix.
>>
> Chris, I have just committed a fix for this issue in r894359 to ofbiz 
> trunk. Now the namespace are handled fine.
>
>
>> 2) Because the passed in parameters are not recognized, I am 
>> receiving service errors.  However, the response appears to have 
>> multiple error messages and not follow the <ServiceName>Response 
>> pattern -  I.e. the error response is just <Response>
>>
> I didn't notice that. I will take a look soon.
> Bilgin
>> I have documented these issues in: OFBIZ-3385  - I'm currently 
>> looking though the code to try and find a resolution, although I 
>> think the first issue may need a change in the way the wsdl is 
>> generated.
>>
>> Many thanks,
>>
>> Chris
>


-- 
Chris Snow - CEng MBCS CITP MBA (Tech Mgmt) (Open) CISSP

Tel: 01453 890660
Mob: 07944 880950
Www: www.snowconsulting.co.uk


Re: any wsdl/xsd experts online?

Posted by Bilgin Ibryam <bi...@gmail.com>.
Christopher Snow wrote:
> Hi Hans,
>
> I've been looking through the code and it looks like a nice job.  I am 
> struggling with a couple of issues though:
>
> 1) The generated wsdl  causes tools (e.g. wsdl2java) to put a 
> namespace prefix on the children of map-Map.  Unfortunately, the 
> SOAPEventHandler and XmlSerializer.derserialize method don't appear to 
> be able to handle the elements with a namespace prefix.
>
Chris, I have just committed a fix for this issue in r894359 to ofbiz 
trunk. Now the namespace are handled fine.


> 2) Because the passed in parameters are not recognized, I am receiving 
> service errors.  However, the response appears to have multiple error 
> messages and not follow the <ServiceName>Response pattern -  I.e. the 
> error response is just <Response>
>
I didn't notice that. I will take a look soon.
Bilgin
> I have documented these issues in: OFBIZ-3385  - I'm currently looking 
> though the code to try and find a resolution, although I think the 
> first issue may need a change in the way the wsdl is generated.
>
> Many thanks,
>
> Chris
 

Re: any wsdl/xsd experts online?

Posted by Hans Bakker <ma...@antwebsystems.com>.
Hi Chris,

i tested the ping webservice provided in ofbiz on the following url:

http://www.validwsdl.com/

enter the url which point to our demo server:
http://ofbizdemo.antwebsystems.com/webtools/control/SOAPService/ping?WSDL

execute the ping service and you can see everything is fine...

any other service you can test there too.

Regards,
Hans


On Tue, 2009-12-29 at 12:26 +0000, Christopher Snow wrote:
> Hi Hans,
> 
> I've been looking through the code and it looks like a nice job.  I am 
> struggling with a couple of issues though:
> 
> 1) The generated wsdl  causes tools (e.g. wsdl2java) to put a namespace 
> prefix on the children of map-Map.  Unfortunately, the SOAPEventHandler 
> and XmlSerializer.derserialize method don't appear to be able to handle 
> the elements with a namespace prefix.
> 
> 2) Because the passed in parameters are not recognized, I am receiving 
> service errors.  However, the response appears to have multiple error 
> messages and not follow the <ServiceName>Response pattern -  I.e. the 
> error response is just <Response>
> 
> I have documented these issues in: OFBIZ-3385  - I'm currently looking 
> though the code to try and find a resolution, although I think the first 
> issue may need a change in the way the wsdl is generated.
> 
> Many thanks,
> 
> Chris
> 
> Hans Bakker wrote:
> > We did the upgrade which was not an easy job...so let us know at
> > support@antwebsystems.com if we can help you.
> >
> > Regards,
> > Hans
> >
> > On Tue, 2009-12-29 at 12:11 +0000, Christopher Snow wrote:
> >   
> >> Are there any wsdl/xsd experts online who can advise on some issues I'm 
> >> having with the latest axis2 ofbiz integration?
> >>
> >> Many thanks in advance,
> >>
> >> Chris
> >>     
> 
-- 
Antwebsystems.com: Quality OFBiz services for competitive rates


Re: any wsdl/xsd experts online?

Posted by Christopher Snow <sn...@snowconsulting.co.uk>.
Hi Hans,

I've been looking through the code and it looks like a nice job.  I am 
struggling with a couple of issues though:

1) The generated wsdl  causes tools (e.g. wsdl2java) to put a namespace 
prefix on the children of map-Map.  Unfortunately, the SOAPEventHandler 
and XmlSerializer.derserialize method don't appear to be able to handle 
the elements with a namespace prefix.

2) Because the passed in parameters are not recognized, I am receiving 
service errors.  However, the response appears to have multiple error 
messages and not follow the <ServiceName>Response pattern -  I.e. the 
error response is just <Response>

I have documented these issues in: OFBIZ-3385  - I'm currently looking 
though the code to try and find a resolution, although I think the first 
issue may need a change in the way the wsdl is generated.

Many thanks,

Chris

Hans Bakker wrote:
> We did the upgrade which was not an easy job...so let us know at
> support@antwebsystems.com if we can help you.
>
> Regards,
> Hans
>
> On Tue, 2009-12-29 at 12:11 +0000, Christopher Snow wrote:
>   
>> Are there any wsdl/xsd experts online who can advise on some issues I'm 
>> having with the latest axis2 ofbiz integration?
>>
>> Many thanks in advance,
>>
>> Chris
>>     


Re: any wsdl/xsd experts online?

Posted by Hans Bakker <ma...@antwebsystems.com>.
We did the upgrade which was not an easy job...so let us know at
support@antwebsystems.com if we can help you.

Regards,
Hans

On Tue, 2009-12-29 at 12:11 +0000, Christopher Snow wrote:
> Are there any wsdl/xsd experts online who can advise on some issues I'm 
> having with the latest axis2 ofbiz integration?
> 
> Many thanks in advance,
> 
> Chris
-- 
Antwebsystems.com: Quality OFBiz services for competitive rates


Re: any wsdl/xsd experts online?

Posted by Adrian Cumiskey <ad...@gmail.com>.
Hi Chris,

I have some recent experience working with Axis 2.  I've generated some
webservice stubs from a WSDL using the ADB approach and provided my
webservice implementation.  I may not be able to help you though as I don't
have any experience with the OFBiz integration.

Adrian Cumiskey.

2009/12/29 Christopher Snow <sn...@snowconsulting.co.uk>

> Are there any wsdl/xsd experts online who can advise on some issues I'm
> having with the latest axis2 ofbiz integration?
>
> Many thanks in advance,
>
> Chris
>