Holly zheng

Greenhorn
+ Follow
since Sep 22, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Holly zheng

Hi, Ivan. I don't know much about the techniques you are talking about, sorry. Just say what I know: I use activevos designer design a bpel project, I have to write a .wsdl that describes the process itself (it is where the problem is). When finished, I deploy the bpel project on active-bpel server. Then it is ready to be invoked. When I design the client side, I used wsdl2java automatically getting the frame of the client side, and wrote a client.java to invoke it. Maybe the techniques you mentioned are done automatically somewhere during the process.


here is the wsdl, maybe you can see it through. I didn't add elementFormDefault="qualified" in the schema tag, that's why I encounter the problem: with no namespace specified in the soap msg.

<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions
targetNamespace="urn:OrderGoodsProcess1.0"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
xmlns:lns="urn:OrderGoodsProcess1.0"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns1="http://scheme"
xmlns:tns="urn:OrderGoodsProcess1.0">

<wsdl:types>
<schema targetNamespace="http://scheme" xmlns="http://www.w3.org/2001/XMLSchema"

elementFormDefault="qualified">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="ExecutionTimeInfo">
<sequence>
<element name="exeTime" type="xsd:float"/>
<element name="prgmInvkTimes" type="xsd:int"/>
</sequence>
</complexType>
</schema>
</wsdl:types>

<wsdl:message name="GoodsRequest">
<wsdl:part name="request" type="xsd:int"/>
</wsdl:message>

<wsdl:message name="GoodsResponse">
<wsdl:part name="response" type="tns1:ExecutionTimeInfo"/>
</wsdl:message>

<wsdl:portType name="orderGoodsServicePT">
<wsdl:operation name="request">
<wsdl:input message="lns:GoodsRequest"/>
<wsdl:output message="lns:GoodsResponse"/>
</wsdl:operation>
</wsdl:portType>

</wsdl:definitions>

Ivan Krizsan wrote:Hi!
Just curious, what web service stack do you use and what kind of data binding mechanism?
I usually use JAXB for XML data binding and have never encountered any problems like the ones you are describing.
Best wishes!

14 years ago
I got some clue. Normally both the SOAP Request and Response Envelope should have the namespace that define the complex type. But I can see through eclipse's web service explorer that the SOAP Request&Response sent and received have no namespace prefix. For example,
the CORRECT soap response envelope should be like this:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<soapenv:Body>
<bpelResponse xmlns:g0 = "http://scheme">
<g0:invkTimes>447</g0:invkTimes>
<g0:executionTime>86.71384</g0:executionTime>
</bpelResponse>
</soapenv:Body>
</soapenv:Envelope>

but what I got is like this:

- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <soapenv:Body>
<invkTimes>447</invkTimes>
<executionTime>86.71384</executionTime>
</soapenv:Body>
</soapenv:Envelope>

with no namespace! So there must be something wrong with my namespace definition.


Ivan Krizsan wrote:Hi!
It sounds like the problem may be related to the data binding.
If you do not manage to solve this in any other way, then you could try to write a web service client that receives and interprets response message itself.
Example:
If you want to use JAXB to do the data binding you use XJC to generate JAXB bean classes from the XML schema describing the message payloads.
In your client, when it receives a response, you use JAXB to unmarshall the payload and thus obtain instance(s) of the JAXB bean classes generated earlier, from which data of the response can be retrieved.

Of course JAXB is just one alternative - if you are happier using StAX, SAX etc. etc. then just go ahead!
Best wishes!

14 years ago
It seems that the bpel web service runs all right and returns right answer, but when the response comes back to the client, something goes wrong. Anyone has any clue? Thanks.



Holly zheng wrote:I have a bpel project deployed on activebpel server. I use the eclipse web service explorer to test the web service, got right answer. but when I use wsdl2java to generate a client to test the web service, the return value is wrong.

request: int
response: timeInfo (class timeInfo{ private float exeTime; private int invkTimes; ...})

In the client java code, I use response = port.request(3); response.getExeTime() and response.getInvkTimes() to get the return value from the web service and I always get 0.0 and 0.

could this be something wrong related to the encoding method: literal? and _resp = _call.invoke(..) can't recognize the response msg automatically? i don't know. can anyone help?

14 years ago
i try to use eclipse's web service client tool. whenever i input a valid service definition, it will inform "No server has been selected. The Web service client will not be deployed, installed, or run." but when i try to select a server (there is only one server to select:activevos server), it will report error "ActiveVOS Server does not support the Apache Axis Web service runtime. Choose a different server or runtime to proceed through the Web services wizard." I have tested the web service through eclipse web service explorer and it is working all right. So does anyone know what's the problem and how to solve it?
14 years ago
I have a bpel project deployed on activebpel server. I use the eclipse web service explorer to test the web service, got right answer. but when I use wsdl2java to generate a client to test the web service, the return value is wrong.

request: int
response: timeInfo (class timeInfo{ private float exeTime; private int invkTimes; ...})

In the client java code, I use response = port.request(3); response.getExeTime() and response.getInvkTimes() to get the return value from the web service and I always get 0.0 and 0.

could this be something wrong related to the encoding method: literal? and _resp = _call.invoke(..) can't recognize the response msg automatically? i don't know. can anyone help?
14 years ago