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);
Holder<MapMap> mapMap =
new Holder<MapMap>(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-Key><std-String value="responseMessage"/></map-Key>
<map-Value><std-String value="success"/></map-Value>
</map-Entry>
<map-Entry>
<map-Key><std-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-Key><std-String value="productsList"/></map-Key>
<map-Value><col-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:Body><ns2:findPartiesById
xmlns:ns2="http://ofbiz.apache.org/service/"><map-Map><ns2:map-Entry><ns2:map-Key><ns2:std-String
value="idToFind"/></ns2:map-Key><ns2:map-Value><ns2:std-String
value="admin"/></ns2:map-Value></ns2:map-Entry><ns2:map-Entry><ns2:map-Key><ns2:std-String
value="login.username"/></ns2:map-Key><ns2:map-Value><ns2:std-String
value="admin"/></ns2:map-Value></ns2:map-Entry><ns2:map-Entry><ns2:map-Key><ns2:std-String
value="login.password"/></ns2:map-Key><ns2:map-Value><ns2:std-String
value="ofbiz"/></ns2:map-Value></ns2:map-Entry></map-Map></ns2:findPartiesById></S:Body></S:Envelope>HTTP/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
Transfer-Encoding: chunked
Vary: Accept-Encoding
Date: Mon, 14 Mar 2011 08:33:49 GMT
4c9
<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><findPartiesByIdResponse
xmlns="http://ofbiz.apache.org/service/"><map-Map>
<map-Entry>
<map-Key>
<std-String value="responseMessage"></std-String>
</map-Key>
<map-Value>
<std-String value="success"></std-String>
</map-Value>
</map-Entry>
<map-Entry>
<map-Key>
<std-String value="party"></std-String>
</map-Key>
<map-Value>
<eeval-Party createdStamp="2011-02-25 10:31:03.948"
createdTxStamp="2011-02-25 10:31:03.712" lastUpdatedStamp="2011-02-25
10:31:10.031" lastUpdatedTxStamp="2011-02-25 10:31:09.945" partyId="admin"
partyTypeId="PERSON"></eeval-Party>
</map-Value>
</map-Entry>
<map-Entry>
<map-Key>
<std-String value="partiesFound"></std-String>
</map-Key>
<map-Value>
<col-Collection></col-Collection>
</map-Value>
</map-Entry>
</map-Map></findPartiesByIdResponse></soapenv:Body></soapenv:Envelope>
0