-
1. Re: PartnerLink with complex type problem
objectiser Feb 11, 2010 10:34 AM (in response to normandesjr)Hi
This sounds like a strange problem - I assume you mean that the 'message' part of the inVar variable is initialised to 'Some message' value - but that the other parts 'from' and 'to' are not present at all?
Could you try initialising all of the message parts in the first 'copy' statement, so:
<copy>
<from><literal><intf2:sendSMS><from xmlns="">99999999</from><to xmlns="">99999999</to><message xmlns="">99999999</message></intf2:sendSMS></literal></from>
<to part="sendSMS" variable="inVar"/>
</copy>If that does not sort out the problem, can you raise a bug and provide a test case.
Regards
Gary
-
2. Re: PartnerLink with complex type problem
normandesjr Feb 11, 2010 11:45 AM (in response to objectiser)Hi,
"I assume you mean that the 'message' part of the inVar variable is initialised to 'Some message' value - but that the other parts 'from' and 'to' are not present at all?"
Yes, you're right. Only the last one is initialized.
Thanks, trying initialize all of the message parts in the first 'copy' statement works! (But I think it could work the way I did, don't you think?)
But I have also another problem. I am trying to pass some soapHeader information to partnerLink. My code is like this:
<bpel:assign validate="no" name="assignInvoke">
<copy>
<from>
<literal>
<intf2:sendSMS>
<from xmlns="">9999999</from>
<to xmlns="">1111111</to>
<message xmlns="">textooo</message>
</intf2:sendSMS>
</literal>
</from>
<to part="sendSMS" variable="inVar"/>
</copy>
<copy>
<from>
<literal>
<intf2:userName>user</intf2:userName>
</literal>
</from>
<to part="userName" variable="inVar"/>
</copy>
</bpel:assign>Where the part 'userName' in variable 'inVar' is a soapHeader input at wsdl. At my partnerLink I couldn't retrieve the header value.
Could you help me with this problem?
Regards,
Normandes Junior.
-
3. Re: PartnerLink with complex type problem
objectiser Feb 11, 2010 12:00 PM (in response to normandesjr)HiThanks, trying initialize all of the message parts in the first 'copy' statement works! (But I think it could work the way I did, don't you think?)
It would seem reasonable - not sure if this is a limitation with ODE, or the way all BPEL engines work. Might be worth asking the question on the Apache ODE user forum.
Where the part 'userName' in variable 'inVar' is a soapHeader input at wsdl. At my partnerLink I couldn't retrieve the header value.
Could you help me with this problem?
In RiftSaw-2.0-CR1, passing header properties mapped using WSDL did not work - however this has now been fixed and is available in the latest snapshot: http://hudson.jboss.org/hudson/job/RiftSaw/
This snapshot also includes a quickstart example that you could check out, to compare to the approach you are using.
Alternatively, CR1 includes a sample/quickstarts/hello_world_header_ode that shows an ODE specific way of accessing SOAP header fields.
Regards
Gary
-
4. Re: PartnerLink with complex type problem
normandesjr Feb 12, 2010 5:59 AM (in response to objectiser)Hi,
I downloaded the snapshot version of Riftsaw and I couldn't add soap header to invoke the partner link.
The examples at snapshot version talk about receive header values at bpel, but what I really need is invoke a partner link and add header values to them.
I am trying to do something like this:
<bpel:assign validate="no" name="assignInvoke">
<copy>
<from>
<literal>
<intf2:sendSMS>
<from xmlns="">9999999</from>
<to xmlns="">1111111</to>
<message xmlns="">textooo</message>
</intf2:sendSMS>
</literal>
</from>
<to part="sendSMS" variable="inVar"/>
</copy>
<copy>
<from>
<literal>
<env:Header>
<intf2:userName>user</intf2:userName>
</env:Header>
</literal>
</from>
<to part="userName" variable="inVar"/>
</copy>
</bpel:assign>As you can see, the second copy is adding header value to partnerLink variable.
Any other tips?
Regards,
Normandes Junior.
-
5. Re: PartnerLink with complex type problem
objectiser Feb 12, 2010 9:00 AM (in response to normandesjr)Hi
I don't think it is possible to set a header property using this approach - because you are trying to copy a SOAP header element into the message content.
The hello_world_header_wsdl example shows how header properties can be mapped into the SOAP message header within the WSDL. This means that in the BPEL, you only need to deal with standard message parts.
For example,
HelloWorld.bpel does the following copy statement:
<copy>
<from variable="myVar" part="conversationId"/>
<to variable="conversationId" />
</copy>This copies the 'conversationId' message part from the message held in the 'myVar' variable into another local variable called 'conversationId'.
If we look at the wsdl, we can see how the 'conversationId' message part is mapped onto the SOAP header part:
<wsdl:message name="HelloMessage">
<wsdl:part name="TestPart" type="xsd:string"/>
<wsdl:part name="conversationId" element="types:conversationId" />
</wsdl:message>The message type simply defines the additional 'conversationId' message part, as if it is part of the message content. However,
<wsdl:operation name="hello">
<soap:operation soapAction="" style="rpc"/>
<wsdl:input>
<soap:body
namespace="http://www.jboss.org/bpel/examples/wsdl"
use="literal" parts="TestPart" />
<soap:header message="tns:HelloMessage"
part="conversationId" use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body
namespace="http://www.jboss.org/bpel/examples/wsdl"
use="literal" parts="TestPart" />
<soap:header message="tns:HelloMessage"
part="conversationId" use="literal"/>
</wsdl:output>
</wsdl:operation>you will notice the <soap:header .... part="conversationId" ... /> elements - this tells the underlying transport to map the 'conversationId' part of the message type into the SOAP message header, instead of the body.
This example is receiving a header property - but the same would work for setting the header property, just change the assign statement to be:
<copy>
<from ..... whereever ..... />
<to variable="myVar" part="conversationId"/>
</copy>Regards
Gary
-
6. Re: PartnerLink with complex type problem
normandesjr Feb 12, 2010 11:26 AM (in response to objectiser)Hi,
I tried to do that, actually the part "userName" is header at my partnerLink. I try do something like you told me:
<copy>
<from><literal><intf2:userName>user</intf2:userName></literal></from>
<to part="userName" variable="inVar"/>
</copy>And didn't work yet.
I think that is not possible invoke a partnerLink with header variable. The examples show how to retrieve header variable that was pass to bpel. What I need is invoke with a header variable.
Have you tested invoke a partner link with a header variable?
Regards,
Junior.
-
7. Re: PartnerLink with complex type problem
objectiser Feb 12, 2010 12:09 PM (in response to normandesjr)The easiest way to demonstrate this is by editing the HelloWorld.bpel in the quickstarts/hello_world_header_wsdl, by adding this additional copy element in the assign:
<copy>
<from>concat($conversationId,'6789')</from>
<to variable="myVar" part="conversationId"/>
</copy>If you then deploy the example (ant deploy), and then run the test (ant sendhello), you will see that the value of the conversation id that was present in the request (12345), has now been returned as (123456789):
sendhello:
[echo] Send test message to: Quickstart_bpel_hello_world_header_wsdl
[java] WARN - 2010-02-12 17:06:53,599 - <org.apache.commons.httpclient.HttpMethodBase> Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
[java] <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header><ns:conversationId xmlns:ns='http://www.jboss.org/cid'>123456789</ns:conversationId></env:Header><env:Body><odens:helloResponse xmlns:odens='http://www.jboss.org/bpel/examples/wsdl'><TestPart>Hello World conversationId=12345</TestPart></odens:helloResponse></env:Body></env:Envelope>
[java]
Let me know if this does not work for you.Regards
Gary
-
8. Re: PartnerLink with complex type problem
normandesjr Feb 12, 2010 12:20 PM (in response to objectiser)Hi,
This works for me. But this is not my problem. I would like to call another webservice (third part web service) using invoke. Follow the bpel code:
<bpel:assign validate="no" name="assignInvoke">
<copy>
<from>
<literal>
<intf2:sendSMS>
<from xmlns="">9999999</from>
<to xmlns="">1111111</to>
<message xmlns="">textooo</message>
</intf2:sendSMS>
</literal>
</from>
<to part="sendSMS" variable="inVar"/>
</copy>
<copy>
<from>
<literal><intf2:userName>user</intf2:userName></literal>
</from>
<to part="userName" variable="inVar"/>
</copy>
</bpel:assign>
<invoke name="InvokeComponentSMS"
partnerLink="componentSMSPartnerLink"
portType="intf2:ComponentSMSCTBC"
operation="sendSMS"
inputVariable="inVar"
outputVariable="outVar"/>Look that the inVar variable is used to a different partnerLink, not the Bpel partnerLink. I have a WebService at other server that I would like call it (using <invoke> tag) and add soap header parameter.
Do you get my problem now?
Thank you for you helping.
Regards,
Normandes Junior.
-
9. Re: PartnerLink with complex type problem
objectiser Feb 12, 2010 12:39 PM (in response to normandesjr)Ok yes, sorry I now understand your situation. We don't have an example covering this, but I'll try it out and get back to you.
Regards
Gary
-
10. Re: PartnerLink with complex type problem
objectiser Feb 15, 2010 7:56 AM (in response to objectiser)Looks like this is a bug. If you could raise an issue in Jira, we will try to get it fixed as soon as possible.
Regards
Gary
-
11. Re: PartnerLink with complex type problem
objectiser Feb 15, 2010 8:13 AM (in response to objectiser)Sorry, I take that back - it is not a bug, I had just made a mistake in my example.
I have attached the working example to demonstrate how to invoke using a header property. The instructions to run this are:
1) When the server has been started, deploy the hello_world_header_wsdl example - this will act as the receiver of the header property (conversationId).
2) Unpack the attached example in the samples/quickstart folder - go to the simple_invoke2 folder, and run "ant deploy".
3) In the simple_invoke2 folder, then run "ant sendhello"
You should see the conversation id, passed in the message in the simple_invoke2/HelloWorld.bpel invoke activity, being returned back to the ant script (value is 54321).
Regards
Gary
-
simple_invoke2.zip 7.5 KB
-
-
12. Re: PartnerLink with complex type problem
normandesjr Feb 17, 2010 8:48 AM (in response to objectiser)Thanks Gary,
Your example works for me. But my example not yet. I realized that your third partner link is with "RPC" as soap binding, and mine is "DOCUMENT". Do you think that this could be a problem?
My third partner link is not a bpel process, is just a Web Service deployed with a war file using annotation @WebService.
Regards,
Normandes Junior.
-
13. Re: PartnerLink with complex type problem
normandesjr Feb 17, 2010 9:11 AM (in response to normandesjr)Even change my third part partner link to rpc didn't work.
Could I send to you the projects for you take a look?
Regards,
Normandes Junior.
-
14. Re: PartnerLink with complex type problem
objectiser Feb 17, 2010 10:04 AM (in response to normandesjr)Hi
Yes it would be good if you could send your example.
Regards
Gary