help with BPEL - copy values inside of complex type array ???

5 messages Options
Embed this post
Permalink
fraespre

help with BPEL - copy values inside of complex type array ???

Reply Threaded More More options
Print post
Permalink
myBpelModule.zip


I have a jirasoapservice-v2.wsdl with:

<complexType name="RemoteIssue">
<complexContent>
<extension base="tns1:AbstractRemoteEntity">
<sequence>
<element name="customFieldValues" nillable="true" type="impl:ArrayOf_tns1_RemoteCustomFieldValue"/>
...
<complexType name="ArrayOf_tns1_RemoteCustomFieldValue">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType"> wsdl:arrayType="tns1:RemoteCustomFieldValue[]"/>
</restriction>
</complexContent>
</complexType>
...
<complexType name="RemoteCustomFieldValue">
<sequence>
<element name="customfieldId" nillable="true" type="xsd:string"/>
<element name="key" nillable="true" type="xsd:string"/>
<element name="values" nillable="true" type="impl:ArrayOf_xsd_string"/>
</sequence>
</complexType>
...


And in BPEL I'm trying this code:

<?xml version="1.0" encoding="UTF-8"?>
<process
name="CosimaJiraProcess"
targetNamespace="http://enterprise.netbeans.org/bpel/BpelModuleCosimaJira/CosimaJiraProcess"
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sxt="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Trace"
xmlns:sxed="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Editor"
xmlns:sxat="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Attachment"
xmlns:sxeh="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/ErrorHandling"
xmlns:tns="http://enterprise.netbeans.org/bpel/BpelModuleCosimaJira/CosimaJiraProcess" xmlns:sxed2="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Editor2" xmlns:ns0="un:CosimaJira:JiraObject" xmlns:ns1="un:CosimaJira:CosimaObject" xmlns:impl="http://localhost/rpc/soap/jirasoapservice-v2" xmlns:ns2="http://beans.soap.rpc.jira.atlassian.com" xmlns:ns3="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:sxxf="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/XPathFunctions">

<import namespace="http://enterprise.netbeans.org/bpel/jirasoapservice-v2Wrapper" location="jirasoapservice-v2Wrapper.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
<import namespace="http://localhost/rpc/soap/jirasoapservice-v2" location="binding/jirasoapservice-v2.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
<import namespace="http://j2ee.netbeans.org/wsdl/BpelModuleCosimaJira/JMSCosimaJiraWSDL" location="binding/JMSCosimaJiraWSDL.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
<partnerLinks>
<partnerLink name="PartnerLink1" xmlns:tns="http://j2ee.netbeans.org/wsdl/BpelModuleCosimaJira/JMSCosimaJiraWSDL" partnerLinkType="tns:JMSCosimaJiraWSDL" myRole="JMSInPortTypeRole"/>
<partnerLink name="plJira" xmlns:tns="http://enterprise.netbeans.org/bpel/jirasoapservice-v2Wrapper" partnerLinkType="tns:JiraSoapServiceLinkType" partnerRole="JiraSoapServiceRole"/>
</partnerLinks>
<variables>
<variable name="JMSInOperationIn" xmlns:tns="http://j2ee.netbeans.org/wsdl/BpelModuleCosimaJira/JMSCosimaJiraWSDL" messageType="tns:JMSInputMessage"/>
<variable name="Token" messageType="impl:loginResponse"/>
<variable name="LoginIn" messageType="impl:loginRequest"/>
<variable name="newIssue" type="ns2:RemoteIssue"/>
<variable name="CreateIssueOut" xmlns:impl="http://localhost/rpc/soap/jirasoapservice-v2" messageType="impl:createIssueResponse"/>
<variable name="CreateIssueIn" xmlns:impl="http://localhost/rpc/soap/jirasoapservice-v2" messageType="impl:createIssueRequest"/>
</variables>
<sequence>
<receive name="Receive1" createInstance="yes" partnerLink="PartnerLink1" operation="JMSInOperation" xmlns:tns="http://j2ee.netbeans.org/wsdl/BpelModuleCosimaJira/JMSCosimaJiraWSDL" portType="tns:JMSInPortType" variable="JMSInOperationIn"/>
<scope name="Scope1">
<variables>
<variable name="cusField1" type="ns2:RemoteCustomFieldValue"/>
</variables>
<sequence name="Sequence1">
<assign name="AssignNewIssue">
<copy>
<from>'probe'</from>
<to>$cusField1/customfieldId</to>
</copy>
<copy>
<from>'summary'</from>
<to>$newIssue/summary</to>
</copy>
<copy>
<from variable="cusField1"/>
<to>$newIssue/customFieldValues[1]</to>
</copy>
</assign>
</sequence>
</scope>
<assign name="LoginAssign">
<copy>
<from>'test'</from>
<to variable="LoginIn" part="in0"/>
</copy>
<copy>
<from>'test'</from>
<to variable="LoginIn" part="in1"/>
</copy>
</assign>
<invoke name="loginJira" partnerLink="plJira" operation="login" portType="impl:JiraSoapService" inputVariable="LoginIn" outputVariable="Token"/>
<assign name="IssueAssign">
<copy>
<from variable="newIssue"/>
<to variable="CreateIssueIn" part="in1"/>
</copy>
<copy>
<from variable="Token" part="loginReturn"/>
<to variable="CreateIssueIn" part="in0"/>
</copy>
</assign>
<invoke name="createIssue" partnerLink="plJira" operation="createIssue" xmlns:impl="http://localhost/rpc/soap/jirasoapservice-v2" portType="impl:JiraSoapService" inputVariable="CreateIssueIn" outputVariable="CreateIssueOut"/>
</sequence>
</process>


None of the 3 ways work:
<copy>
<from variable="cusField1"/>
<to>$newIssue/customFieldValues[1]/ns2:RemoteCustomFieldValue</to>
</copy>
<copy>
<from variable="cusField1"/>
<to>$newIssue/customFieldValues/impl:RemoteCustomFieldValue[1]</to>
</copy>
<copy>
<from variable="cusField1"/>
<to>$newIssue/customFieldValues[1]*</to>
</copy>

Any ideas, advice or suggestions ???

Thanks,

Nikita Krjukov

Re: help with BPEL - copy values inside of complex type array ???

Reply Threaded More More options
Print post
Permalink
Hi

It looks like there is a bug here. I've already found at least one of
them and continue my investigation. I'll inform you later.

Nikita


fraespre wrote:

> http://n2.nabble.com/file/n3769000/myBpelModule.zip myBpelModule.zip
>
>
> I have a jirasoapservice-v2.wsdl with:
>
>
> None of the 3 ways work:
> <copy>
> <from variable="cusField1"/>
> <to>$newIssue/customFieldValues[1]/ns2:RemoteCustomFieldValue</to>
> </copy>
> <copy>
> <from variable="cusField1"/>
> <to>$newIssue/customFieldValues/impl:RemoteCustomFieldValue[1]</to>
> </copy>
> <copy>
> <from variable="cusField1"/>
> <to>$newIssue/customFieldValues[1]*</to>
> </copy>
>
> Any ideas, advice or suggestions ???
>
> Thanks,
>
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Nikita Krjukov

Re: help with BPEL - copy values inside of complex type array ???

Reply Threaded More More options
Print post
Permalink
Hi again

It looks like there is a problem with using remote schema
http://schemas.xmlsoap.org/soap/encoding/
It is imported by jirasoapservice-v2.wsdl
By some unknown reason the schema can't be correctly recognized by
importing schema (which is embedded to wsdl)
It is definitely a bug.

I can suggest temporary workaround. You can copy remote schema somewhere
locally. For example, you can add directly it to your project.
I tried it and now I can see another picture in BPEL mapper. See the
attached picture AfterMakingRemoteSchemaLocal.png
You can see that item customFieldValues has some children.

====================

But there is another problem with your project. Tree item
customFieldValues still doesn't allow you to access the Array's content.
It's necessary to have xsd:any visible inside of customFieldValues
element. I think it because of your schema. Look the reference
http://www.w3.org/TR/xmlschema-0/#DerivByRestrict
> Notice that types derived by restriction must repeat all the particle
> components (element declarations, model groups, and wildcards) of the
> base type definition that are to be included in the derived type.
> However, attribute declarations do not need to be repeated in the
> derived type definition; in this example,
The jirasoapservice-v2.wsdl contains the declaration:
>    <complexType name="ArrayOf_tns1_RemoteCustomFieldValue">
>     <complexContent>
>      <restriction base="soapenc:Array">
>       <attribute ref="soapenc:arrayType"
> wsdl:arrayType="tns1:RemoteCustomFieldValue[]"/>
>      </restriction>
>     </complexContent>
>    </complexType>
Notice that type ArrayOf_tns1_RemoteCustomFieldValue doesn't repeat
<xsd:any> declaration from the base type Array.
The xsd:any is a kind of element declaration so I reckon it has to be
redeclared to be part of ArrayOf_tns1_RemoteCustomFieldValue

The BPEL mapper now builds its tree according to this rule. It shows
only children which defined by the schema.
I tried our XML Schema Editor (Design tab) and XML document validator
and they do the same.

Regards
Nikita

Nikita Krjukov wrote:

> Hi
>
> It looks like there is a bug here. I've already found at least one of
> them and continue my investigation. I'll inform you later.
>
> Nikita
>
>
> fraespre wrote:
>  
>> http://n2.nabble.com/file/n3769000/myBpelModule.zip myBpelModule.zip
>>
>>
>> I have a jirasoapservice-v2.wsdl with:
>>
>>
>> None of the 3 ways work:
>> <copy>
>> <from variable="cusField1"/>
>> <to>$newIssue/customFieldValues[1]/ns2:RemoteCustomFieldValue</to>
>> </copy>
>> <copy>
>> <from variable="cusField1"/>
>> <to>$newIssue/customFieldValues/impl:RemoteCustomFieldValue[1]</to>
>> </copy>
>> <copy>
>> <from variable="cusField1"/>
>> <to>$newIssue/customFieldValues[1]*</to>
>> </copy>
>>
>> Any ideas, advice or suggestions ???
>>
>> Thanks,
>>
>>
>>  
>>    
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

AfterMaikingRemoteSchemaLocal.png (18K) Download Attachment
Sergey Lunegov

Re: help with BPEL - copy values inside of complex type array ???

Reply Threaded More More options
Print post
Permalink
The following issue was filed and fixed:

http://www.netbeans.org/issues/show_bug.cgi?id=174186



User yaroslavskiy changed the following:

                What    |Old value                 |New value
================================================================================
                      CC|''                        |'supernikita'
--------------------------------------------------------------------------------
                  Status|NEW                       |RESOLVED
--------------------------------------------------------------------------------
              Resolution|                          |FIXED
--------------------------------------------------------------------------------


Thanks,
Sergey



Nikita Krjukov wrote:

> Hi again
>
> It looks like there is a problem with using remote schema
> http://schemas.xmlsoap.org/soap/encoding/
> It is imported by jirasoapservice-v2.wsdl
> By some unknown reason the schema can't be correctly recognized by
> importing schema (which is embedded to wsdl)
> It is definitely a bug.
>
> I can suggest temporary workaround. You can copy remote schema somewhere
> locally. For example, you can add directly it to your project.
> I tried it and now I can see another picture in BPEL mapper. See the
> attached picture AfterMakingRemoteSchemaLocal.png
> You can see that item customFieldValues has some children.
>
> ====================
>
> But there is another problem with your project. Tree item
> customFieldValues still doesn't allow you to access the Array's content.
> It's necessary to have xsd:any visible inside of customFieldValues
> element. I think it because of your schema. Look the reference
> http://www.w3.org/TR/xmlschema-0/#DerivByRestrict
>  
>> Notice that types derived by restriction must repeat all the particle
>> components (element declarations, model groups, and wildcards) of the
>> base type definition that are to be included in the derived type.
>> However, attribute declarations do not need to be repeated in the
>> derived type definition; in this example,
>>    
> The jirasoapservice-v2.wsdl contains the declaration:
>  
>>    <complexType name="ArrayOf_tns1_RemoteCustomFieldValue">
>>     <complexContent>
>>      <restriction base="soapenc:Array">
>>       <attribute ref="soapenc:arrayType"
>> wsdl:arrayType="tns1:RemoteCustomFieldValue[]"/>
>>      </restriction>
>>     </complexContent>
>>    </complexType>
>>    
> Notice that type ArrayOf_tns1_RemoteCustomFieldValue doesn't repeat
> <xsd:any> declaration from the base type Array.
> The xsd:any is a kind of element declaration so I reckon it has to be
> redeclared to be part of ArrayOf_tns1_RemoteCustomFieldValue
>
> The BPEL mapper now builds its tree according to this rule. It shows
> only children which defined by the schema.
> I tried our XML Schema Editor (Design tab) and XML document validator
> and they do the same.
>
> Regards
> Nikita
>
> Nikita Krjukov wrote:
>  
>> Hi
>>
>> It looks like there is a bug here. I've already found at least one of
>> them and continue my investigation. I'll inform you later.
>>
>> Nikita
>>
>>
>> fraespre wrote:
>>  
>>    
>>> http://n2.nabble.com/file/n3769000/myBpelModule.zip myBpelModule.zip
>>>
>>>
>>> I have a jirasoapservice-v2.wsdl with:
>>>
>>>
>>> None of the 3 ways work:
>>> <copy>
>>> <from variable="cusField1"/>
>>> <to>$newIssue/customFieldValues[1]/ns2:RemoteCustomFieldValue</to>
>>> </copy>
>>> <copy>
>>> <from variable="cusField1"/>
>>> <to>$newIssue/customFieldValues/impl:RemoteCustomFieldValue[1]</to>
>>> </copy>
>>> <copy>
>>> <from variable="cusField1"/>
>>> <to>$newIssue/customFieldValues[1]*</to>
>>> </copy>
>>>
>>> Any ideas, advice or suggestions ???
>>>
>>> Thanks,
>>>
>>>
>>>  
>>>    
>>>      
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>  
>>    
>
>  
>
> ------------------------------------------------------------------------
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

fraespre

Re: help with BPEL - copy values inside of complex type array ???

Reply Threaded More More options
Print post
Permalink
In reply to this post by Nikita Krjukov
Nikita, thank you for your help.

I started downloading to a local file encoding.xsd
After I made the following modification in the wsdl:
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="../schemas/encoding.xsd"/>
Perfect, I can now introduce the predicate for the index and assign it, I have put in your image.

However there is a new problem:
   WARNING: The types of "From" and "To" activities are different: "RemoteCustomFieldValue" and "ArrayOf_tns1_RemoteCustomFieldValue".
I understand that is the second part of what you said "Tree item
customFieldValues still doesn't allow you to access the Array's content"

To solve this second problem, I understand that should make the following change:
<complexType name="ArrayOf_tns1_RemoteCustomFieldValue">
<complexContent>
<restriction base="soapenc:Array">
   <sequence>
     <element name="customfieldId" nillable="true" type="xsd:string"/>
     <element name="key" nillable="true" type="xsd:string"/>
     <element name="values" nillable="true" type="impl:ArrayOf_xsd_string"/>
   </sequence>
</restriction>
</complexContent>
</complexType>
Please confirm me if what you meant.

I confess that I find it strange that need to modify the definitions in the wsdl, especially when the rest soap client using Jira product not appear to have any problems with wsdl.
http://confluence.atlassian.com/display/JIRA/Creating+a+XML-RPC+Client

Again thank you very much for your help.

javier