Re: Web services - jaxb binding
Interesting... Looking forward Jacques From: Alexander Graf alex.g...@student.htw-berlin.de Okay I got something interesting: http://synodinos.net/2007/08/02/web-services-interoperability-fable-with-java-and-php/ The author Dionysios G. Synodinos says, that An ENVELOPE described with an rpc-literal binding MUST place the part accessor elements for parameters and return value in no namespace. That means the response of ofbiz is ignored, because ?xml version=1.0 encoding=utf-8?soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/;soapenv:BodyfindPartiesByIdResponse xmlns=http://ofbiz.apache.org/service/;map-Map contains the namespace http://ofbiz.apache.org/service/ Let's play a bit and find out how to disable it. Maybe that's the reason for all the trouble. Regards Alexander
Re: Web services - jaxb binding
Okay it is definitely not working. I commented out the lines: OMAttribute defaultNS = factory.createOMAttribute(xmlns, null, ModelService.TNS); resService.addAttribute(defaultNS); in org.ofbiz.webapp.event.SOAPEventHandler and got a response without xmlns=http://ofbiz.apache.org/service/ but it is still not working. The response is not unmarshalled, seems to be ignored. Any ideas? is there really nobody who uses jax-ws??? Am 16.03.2011, 08:43 Uhr, schrieb Jacques Le Roux j...@les7arts.com: Interesting... Looking forward Jacques From: Alexander Graf alex.g...@student.htw-berlin.de Okay I got something interesting: http://synodinos.net/2007/08/02/web-services-interoperability-fable-with-java-and-php/ The author Dionysios G. Synodinos says, that An ENVELOPE described with an rpc-literal binding MUST place the part accessor elements for parameters and return value in no namespace. That means the response of ofbiz is ignored, because ?xml version=1.0 encoding=utf-8?soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/;soapenv:BodyfindPartiesByIdResponse xmlns=http://ofbiz.apache.org/service/;map-Map contains the namespace http://ofbiz.apache.org/service/ Let's play a bit and find out how to disable it. Maybe that's the reason for all the trouble. Regards Alexander
Re: Web services - jaxb binding
Okay I got something interesting: http://synodinos.net/2007/08/02/web-services-interoperability-fable-with-java-and-php/ The author Dionysios G. Synodinos says, that An ENVELOPE described with an rpc-literal binding MUST place the part accessor elements for parameters and return value in no namespace. That means the response of ofbiz is ignored, because ?xml version=1.0 encoding=utf-8?soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/;soapenv:BodyfindPartiesByIdResponse xmlns=http://ofbiz.apache.org/service/;map-Map contains the namespace http://ofbiz.apache.org/service/ Let's play a bit and find out how to disable it. Maybe that's the reason for all the trouble. Regards Alexander
Re: Web services - jaxb binding
Hi, I have the same Problem, ofbiz sends an answer, but it never appears in the holder. MapMap myMap = new MapMap(); myMap.getMapEntry().add(mapEntry); myMap.getMapEntry().add(mapEntryLogin); myMap.getMapEntry().add(mapEntryPassword); HolderMapMap mapMap = new HolderMapMap(myMap); port.findPartiesById(mapMap); for(MapEntry e : mapMap.value.getMapEntry()){ System.out.println(e.getMapKey() + + e.getMapValue()); } The code simply prints out the IN parameters, no out parameters, although the response was retrieved. (see attachment) So here's what I did. I downloaded the wsdl and added appended the entity name to this element. Then re-generated the client stub. Is this what you did? xsd:element name=eeval-Product type=tns:map-Map I didn't do that, it makes no sense for me to rewrite the wsdl. Why isn't it generated with the entity name? The part how to get the binding working is skipped in all tutorials. So here a second request: please tell us how. There are people who asked this years ago and never got an answer. Why? Isn't this an essential part of ofbiz? For me it is, because we want to use a Java SE client. I can not imagine that we are the first who want to do that. Thanks in advance. Alexander Am 12.03.2011, 03:28 Uhr, schrieb Mansour Al Akeel mansour.alak...@gmail.com: Hello all, I am not advanced in web services, so bear with me. I am trying to create a client to call some functions through webservices. The web services in ofbiz use maps. For example, I am trying to obtain a product by id. The web service response includes the product as eeval-Product. In the wsdl for this service, I can see: xsd:element name=eeval- type=tns:map-Map xsd:annotation xsd:documentation The name of element need to be appended with name of entity such as eeval-Product for Product entity. /xsd:documentation /xsd:annotation /xsd:element So here's what I did. I downloaded the wsdl and added appended the entity name to this element. Then re-generated the client stub. Now when a response is retireved it's obtained correctely, but the binding doesn't work. For example, eeval-Product is a Map, but it's null. Attributtes from this element are not bound, they are skipped by the binding generated with wsdl2java with jaxb binding. What would be the best way/tool to include the attributes from eeval-Product into the map ? Here's an exmaple response. ?xml version=1.0? findProductByIdResponse xmlns=http://ofbiz.apache.org/service/; map-Map map-Entry map-Keystd-String value=responseMessage//map-Key map-Valuestd-String value=success//map-Value /map-Entry map-Entry map-Keystd-String value=product//map-Key map-Value eeval-Product billOfMaterialLevel=0 createdByUserLogin=admin createdDate=2004-08-20 12:49:13.418 createdStamp=2011-02-24 09:30:52.287 createdTxStamp=2011-02-24 09:30:52.186 description=Create your own pizza internalName=Pizza isVariant=N isVirtual=N largeImageUrl=/images/products/PIZZA/large.png lastUpdatedStamp=2011-03-06 21:09:44.134 lastUpdatedTxStamp=2011-03-06 21:09:43.527 productId=PIZZA productName=Gold Pizza productTypeId=AGGREGATED smallImageUrl=/images/products/PIZZA/small.png/ /map-Value /map-Entry map-Entry map-Keystd-String value=productsList//map-Key map-Valuecol-Collection//map-Value /map-Entry /map-Map /findProductByIdResponse Any advice ? POST /webtools/control/SOAPService HTTP/1.1 Content-type: text/xml;charset=utf-8 Soapaction: http://127.0.0.1:8080/webtools/control/SOAPService; Accept: text/xml, multipart/related, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 User-Agent: JAX-WS RI 2.1.6 in JDK 6 Host: 127.0.0.1:8080 Connection: keep-alive Content-Length: 697 ?xml version=1.0 ?S:Envelope xmlns:S=http://schemas.xmlsoap.org/soap/envelope/;S:Bodyns2:findPartiesById xmlns:ns2=http://ofbiz.apache.org/service/;map-Mapns2:map-Entryns2:map-Keyns2:std-String value=idToFind//ns2:map-Keyns2:map-Valuens2:std-String value=admin//ns2:map-Value/ns2:map-Entryns2:map-Entryns2:map-Keyns2:std-String value=login.username//ns2:map-Keyns2:map-Valuens2:std-String value=admin//ns2:map-Value/ns2:map-Entryns2:map-Entryns2:map-Keyns2:std-String value=login.password//ns2:map-Keyns2:map-Valuens2:std-String value=ofbiz//ns2:map-Value/ns2:map-Entry/map-Map/ns2:findPartiesById/S:Body/S:EnvelopeHTTP/1.1 200 OK Server: Apache-Coyote/1.1 Set-Cookie: JSESSIONID=1A4D3D9FE02D3E64F491950879A27CAA.jvm1; Path=/webtools Set-Cookie: OFBiz.Visitor=10190; Expires=Tue, 13-Mar-2012 08:33:48 GMT; Path=/ Content-Type: text/xml;charset=utf-8
Web services - jaxb binding
Hello all, I am not advanced in web services, so bear with me. I am trying to create a client to call some functions through webservices. The web services in ofbiz use maps. For example, I am trying to obtain a product by id. The web service response includes the product as eeval-Product. In the wsdl for this service, I can see: xsd:element name=eeval- type=tns:map-Map xsd:annotation xsd:documentation The name of element need to be appended with name of entity such as eeval-Product for Product entity. /xsd:documentation /xsd:annotation /xsd:element So here's what I did. I downloaded the wsdl and added appended the entity name to this element. Then re-generated the client stub. Now when a response is retireved it's obtained correctely, but the binding doesn't work. For example, eeval-Product is a Map, but it's null. Attributtes from this element are not bound, they are skipped by the binding generated with wsdl2java with jaxb binding. What would be the best way/tool to include the attributes from eeval-Product into the map ? Here's an exmaple response. ?xml version=1.0? findProductByIdResponse xmlns=http://ofbiz.apache.org/service/; map-Map map-Entry map-Keystd-String value=responseMessage//map-Key map-Valuestd-String value=success//map-Value /map-Entry map-Entry map-Keystd-String value=product//map-Key map-Value eeval-Product billOfMaterialLevel=0 createdByUserLogin=admin createdDate=2004-08-20 12:49:13.418 createdStamp=2011-02-24 09:30:52.287 createdTxStamp=2011-02-24 09:30:52.186 description=Create your own pizza internalName=Pizza isVariant=N isVirtual=N largeImageUrl=/images/products/PIZZA/large.png lastUpdatedStamp=2011-03-06 21:09:44.134 lastUpdatedTxStamp=2011-03-06 21:09:43.527 productId=PIZZA productName=Gold Pizza productTypeId=AGGREGATED smallImageUrl=/images/products/PIZZA/small.png/ /map-Value /map-Entry map-Entry map-Keystd-String value=productsList//map-Key map-Valuecol-Collection//map-Value /map-Entry /map-Map /findProductByIdResponse Any advice ?