You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsif-user@ws.apache.org by Aparicio <Ma...@ciber.no> on 2006/08/15 09:55:27 UTC

WSIF vs. OracleBPEL , namespace issue

Hi fellow WSIF users.
I am trying to create a simple client to call BPEL processes through the
WSIF framework. I  use the Axis SOAP provider, but I seem to be running into
some namespace issues. The BPEL process has a "process" method that takes in
a person element consisting of name and address fields. The type is defined
in an XSD imported into the wsdl. Here's the BPEL process' WSDL definition:

------------------------------------------------------------
<definitions
     name="ConvertPerson"
     targetNamespace="http://ciber.no/ConvertPerson"
     xmlns="http://schemas.xmlsoap.org/wsdl/"
     xmlns:tns="http://ciber.no/ConvertPerson"
     xmlns:ns1="http://types.ciber.no"
     xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
     xmlns:client="http://ciber.no/ConvertPerson"
    >
    <types>
        <xsd:schema xmlns:client="http://ciber.no/ConvertPerson"
xmlns:ns1="http://types.ciber.no"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <xsd:import namespace="http://types.ciber.no"
schemaLocation="Person.xsd"/>
        </xsd:schema>
        <xsd:schema xmlns:client="http://ciber.no/ConvertPerson"
xmlns:ns1="http://types.ciber.no"
            
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <xsd:import namespace="http://types.ciber.no"
schemaLocation="ConvertedPerson.xsd"/>
        </xsd:schema>
    </types>

    <message name="ConvertPersonRequestMessage">
        <part name="payload" element="ns1:person"/>
    </message>
    <message name="ConvertPersonResponseMessage">
        <part name="payload" element="ns1:ConvertedPerson"/>
    </message>
    <portType name="ConvertPerson">
        <operation name="process">
            <input message="tns:ConvertPersonRequestMessage"/>

            <output message="tns:ConvertPersonResponseMessage"/>
        </operation>
    </portType>
    <binding name="ConvertPersonBinding" type="tns:ConvertPerson">
        <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="process">
            <soap:operation style="document" soapAction="process"/>
            <input>
                <soap:body use="literal"/>

            </input>
            <output>
                <soap:body use="literal"/>
            </output>
        </operation>
    </binding>
    <service name="ConvertPerson">
        <port name="ConvertPersonPort" binding="tns:ConvertPersonBinding">
            <soap:address
location="http://NOLMarApa:9700/orabpel/default/ConvertPerson/1.0"/>

        </port>
    </service>
  <plnk:partnerLinkType name="ConvertPerson">
    <plnk:role name="ConvertPersonProvider">
      <plnk:portType name="tns:ConvertPerson"/>
    </plnk:role>
  </plnk:partnerLinkType>
</definitions>
-----------------------------------------------------------------------------------



Here's the Person.xsd
---------------------------------------------------------------
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://types.ciber.no"
            targetNamespace="http://types.ciber.no"
elementFormDefault="qualified">
  <xsd:element name="person">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="name" type="xsd:string"/>
        <xsd:element name="address" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

</xsd:schema>
------------------------------------------------------------------------------------------


Here is my java code:
-----------------------------------------------------------------------------------
package no.ciber.wsiftest;

import javax.xml.namespace.QName;

import junit.framework.TestCase;

import org.apache.wsif.WSIFMessage;
import org.apache.wsif.WSIFOperation;
import org.apache.wsif.WSIFPort;
import org.apache.wsif.WSIFService;
import org.apache.wsif.WSIFServiceFactory;

public class Client extends TestCase {

	
		public void testProcess() {
			
			String wsdlLocation =
"http://NOLMarApa:9700/orabpel/default/ConvertPerson/1.0/ConvertPerson?wsdl";
		
			
			WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
			try {
				WSIFService service = factory.getService(wsdlLocation, 
						null, 
						"ConvertPerson", 
						null, 
						"ConvertPerson");
				
				
				service.mapType(new QName("http://types.ciber.no","person"),
Person.class);
				service.mapType(new QName("http://types.ciber.no","ConvertedPerson"),
ConvertedPerson.class);
				
				
				WSIFPort port = service.getPort("ConvertPersonPort");
				WSIFOperation operation = port.createOperation("process",
"PersonConvertRequestMessage", "PersonConvertResponseMessage");
				
				WSIFMessage inputMessage = operation.createInputMessage();
				WSIFMessage outputMessage = operation.createOutputMessage();
				WSIFMessage faultMessage = operation.createFaultMessage();
				
				Person request = new Person();
				request.setName("John Doe");
				request.setAddress("Mystreet 11");
				
				inputMessage.setObjectPart("payload", request);
				boolean success =
operation.executeRequestResponseOperation(inputMessage, outputMessage,
faultMessage);
				
				if(success== true) {
					ConvertedPerson response = (ConvertedPerson)
outputMessage.getObjectPart("payload");
					System.out.println("Recieved: " + response.getResult());
				} else {
					System.err.println("Something else happened!");
				}
				
			} catch (Exception e) {
				e.printStackTrace();
			}	
			
		}
		
		public static void main(String []args) {
			Client client = new Client();
			client.testProcess();
		}
		
}

-------------------------------------------------------------------------------------------------------
The Person.java object representing the request element, is a simple
JavaBean with name and address variables.



What happens?

When calling the BPEL process using this code, WSIF somehow mixes up the
namespace of the Person object. A correct request message payload should be:

<person xmlns="http://types.ciber.no"><name>John Doe</name><address>Mystreet
11</address></person></part>

However, WSIF produces the following request object:

<person><address>Mystreet 11</address><name>John Doe</name></person>

As shown, WSIF omits the "http://types.ciber.no" namespace in the <person>
elements. This results in an error since the BPEL process can't resolve the
xpath expression /ns1:person/ns1:name or ns1:address

This call was made using the 2.0.1_IB3 . The 2.0 version also fails.

Does anyone have a clue what's happening here?


-Mario Aparicio
-- 
View this message in context: http://www.nabble.com/WSIF-vs.-OracleBPEL-%2C-namespace-issue-tf2107951.html#a5810320
Sent from the WSIF - User forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: wsif-user-unsubscribe@ws.apache.org
For additional commands, e-mail: wsif-user-help@ws.apache.org


Re: WSIF vs. OracleBPEL , namespace issue

Posted by Aleksander Slominski <as...@cs.indiana.edu>.
Aparicio wrote:
> Thanks for quick response.
> I have tried upgrading to WSIF 2.1.0-rc1, it did not solve the problem. I am
> attemtpting to get more info out of the trace now. 
>
> I would also note that the 2.1.0 version seems to have been compiled with
> Java 5.0 compliance.
>   
i will fix this in build.xml and next release candidate should not have
this problem.

thanks,

alek
>
> Aleksander Slominski wrote:
>   
>> hi Mario,
>>
>> hard to say - it would be useful to confirm that AXIS1 when used alone
>> is ending the XML messages you want. you may also want to enable
>> tracing/logging in WSIF (and AXIS) to see what is going on.
>>
>> if possible also please try the latest pre-release 2.1.0 version (it
>> should have more recent AXIS jar used) from
>>
>> http://people.apache.org/dist/ws/wsif/
>>
>> thanks,
>>
>> alek
>>
>> -- 
>> The best way to predict the future is to invent it - Alan Kay
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: wsif-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: wsif-user-help@ws.apache.org
>>
>>
>>
>>     
>
>   


-- 
The best way to predict the future is to invent it - Alan Kay


---------------------------------------------------------------------
To unsubscribe, e-mail: wsif-user-unsubscribe@ws.apache.org
For additional commands, e-mail: wsif-user-help@ws.apache.org


question on JMS binding - how to set username/pw to create a secure queue connection?

Posted by Shantanu Sen <ss...@pacbell.net>.
If we secure a queue on an appserver (JBoss) so that a specific role is allowed to do pub/sub on it. In order to publish on the queue the queue connection needs to be created with the username/pw (a user that belongs to the specified role) - e.g. queueConnectionFactory.createQueueConnection(username, pw).

How can I specify the username/pw so that WSIF JMS provider creates the connection with this? The WSIFJMSDestination is responsible for creating the queue connection, but I do not see any code that creates a secure connection.

Thanks for any help.
Shantanu Sen


---------------------------------------------------------------------
To unsubscribe, e-mail: wsif-user-unsubscribe@ws.apache.org
For additional commands, e-mail: wsif-user-help@ws.apache.org


Re: WSIF vs. OracleBPEL , namespace issue

Posted by Aparicio <Ma...@ciber.no>.
Thanks for quick response.
I have tried upgrading to WSIF 2.1.0-rc1, it did not solve the problem. I am
attemtpting to get more info out of the trace now. 

I would also note that the 2.1.0 version seems to have been compiled with
Java 5.0 compliance.

-Mario


Aleksander Slominski wrote:
> 
> 
> hi Mario,
> 
> hard to say - it would be useful to confirm that AXIS1 when used alone
> is ending the XML messages you want. you may also want to enable
> tracing/logging in WSIF (and AXIS) to see what is going on.
> 
> if possible also please try the latest pre-release 2.1.0 version (it
> should have more recent AXIS jar used) from
> 
> http://people.apache.org/dist/ws/wsif/
> 
> thanks,
> 
> alek
> 
> -- 
> The best way to predict the future is to invent it - Alan Kay
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wsif-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: wsif-user-help@ws.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/WSIF-vs.-OracleBPEL-%2C-namespace-issue-tf2107951.html#a5846327
Sent from the WSIF - User forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: wsif-user-unsubscribe@ws.apache.org
For additional commands, e-mail: wsif-user-help@ws.apache.org


pre-release 2.1.0

Posted by "Jackson, Douglas" <dj...@ugs.com>.
Hi!
I promised to give some feedback about 2.1.0.  We have now
incorporated the 2.1.0 pre-release into our product replacing
2.0.  So, I give it my blessing :).
One change (that makes sense) was that XSDs imported by WSDLs are
actually imported and need to be resolved.

http://people.apache.org/dist/ws/wsif/

Thanks!
-Doug.


---------------------------------------------------------------------
To unsubscribe, e-mail: wsif-user-unsubscribe@ws.apache.org
For additional commands, e-mail: wsif-user-help@ws.apache.org


Re: WSIF vs. OracleBPEL , namespace issue

Posted by Aleksander Slominski <as...@cs.indiana.edu>.
Aparicio wrote:
> Hi fellow WSIF users.
> I am trying to create a simple client to call BPEL processes through the
> WSIF framework. I  use the Axis SOAP provider, but I seem to be running into
> some namespace issues. The BPEL process has a "process" method that takes in
> a person element consisting of name and address fields. The type is defined
> in an XSD imported into the wsdl. Here's the BPEL process' WSDL definition:
>
> ------------------------------------------------------------
> <definitions
>      name="ConvertPerson"
>      targetNamespace="http://ciber.no/ConvertPerson"
>      xmlns="http://schemas.xmlsoap.org/wsdl/"
>      xmlns:tns="http://ciber.no/ConvertPerson"
>      xmlns:ns1="http://types.ciber.no"
>      xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
>      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>      xmlns:client="http://ciber.no/ConvertPerson"
>     >
>     <types>
>         <xsd:schema xmlns:client="http://ciber.no/ConvertPerson"
> xmlns:ns1="http://types.ciber.no"
> xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
>              xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>             <xsd:import namespace="http://types.ciber.no"
> schemaLocation="Person.xsd"/>
>         </xsd:schema>
>         <xsd:schema xmlns:client="http://ciber.no/ConvertPerson"
> xmlns:ns1="http://types.ciber.no"
>             
> xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>             <xsd:import namespace="http://types.ciber.no"
> schemaLocation="ConvertedPerson.xsd"/>
>         </xsd:schema>
>     </types>
>
>     <message name="ConvertPersonRequestMessage">
>         <part name="payload" element="ns1:person"/>
>     </message>
>     <message name="ConvertPersonResponseMessage">
>         <part name="payload" element="ns1:ConvertedPerson"/>
>     </message>
>     <portType name="ConvertPerson">
>         <operation name="process">
>             <input message="tns:ConvertPersonRequestMessage"/>
>
>             <output message="tns:ConvertPersonResponseMessage"/>
>         </operation>
>     </portType>
>     <binding name="ConvertPersonBinding" type="tns:ConvertPerson">
>         <soap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
>         <operation name="process">
>             <soap:operation style="document" soapAction="process"/>
>             <input>
>                 <soap:body use="literal"/>
>
>             </input>
>             <output>
>                 <soap:body use="literal"/>
>             </output>
>         </operation>
>     </binding>
>     <service name="ConvertPerson">
>         <port name="ConvertPersonPort" binding="tns:ConvertPersonBinding">
>             <soap:address
> location="http://NOLMarApa:9700/orabpel/default/ConvertPerson/1.0"/>
>
>         </port>
>     </service>
>   <plnk:partnerLinkType name="ConvertPerson">
>     <plnk:role name="ConvertPersonProvider">
>       <plnk:portType name="tns:ConvertPerson"/>
>     </plnk:role>
>   </plnk:partnerLinkType>
> </definitions>
> -----------------------------------------------------------------------------------
>
>
>
> Here's the Person.xsd
> ---------------------------------------------------------------
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>             xmlns="http://types.ciber.no"
>             targetNamespace="http://types.ciber.no"
> elementFormDefault="qualified">
>   <xsd:element name="person">
>     <xsd:complexType>
>       <xsd:sequence>
>         <xsd:element name="name" type="xsd:string"/>
>         <xsd:element name="address" type="xsd:string"/>
>       </xsd:sequence>
>     </xsd:complexType>
>   </xsd:element>
>
> </xsd:schema>
> ------------------------------------------------------------------------------------------
>
>
> Here is my java code:
> -----------------------------------------------------------------------------------
> package no.ciber.wsiftest;
>
> import javax.xml.namespace.QName;
>
> import junit.framework.TestCase;
>
> import org.apache.wsif.WSIFMessage;
> import org.apache.wsif.WSIFOperation;
> import org.apache.wsif.WSIFPort;
> import org.apache.wsif.WSIFService;
> import org.apache.wsif.WSIFServiceFactory;
>
> public class Client extends TestCase {
>
> 	
> 		public void testProcess() {
> 			
> 			String wsdlLocation =
> "http://NOLMarApa:9700/orabpel/default/ConvertPerson/1.0/ConvertPerson?wsdl";
> 		
> 			
> 			WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
> 			try {
> 				WSIFService service = factory.getService(wsdlLocation, 
> 						null, 
> 						"ConvertPerson", 
> 						null, 
> 						"ConvertPerson");
> 				
> 				
> 				service.mapType(new QName("http://types.ciber.no","person"),
> Person.class);
> 				service.mapType(new QName("http://types.ciber.no","ConvertedPerson"),
> ConvertedPerson.class);
> 				
> 				
> 				WSIFPort port = service.getPort("ConvertPersonPort");
> 				WSIFOperation operation = port.createOperation("process",
> "PersonConvertRequestMessage", "PersonConvertResponseMessage");
> 				
> 				WSIFMessage inputMessage = operation.createInputMessage();
> 				WSIFMessage outputMessage = operation.createOutputMessage();
> 				WSIFMessage faultMessage = operation.createFaultMessage();
> 				
> 				Person request = new Person();
> 				request.setName("John Doe");
> 				request.setAddress("Mystreet 11");
> 				
> 				inputMessage.setObjectPart("payload", request);
> 				boolean success =
> operation.executeRequestResponseOperation(inputMessage, outputMessage,
> faultMessage);
> 				
> 				if(success== true) {
> 					ConvertedPerson response = (ConvertedPerson)
> outputMessage.getObjectPart("payload");
> 					System.out.println("Recieved: " + response.getResult());
> 				} else {
> 					System.err.println("Something else happened!");
> 				}
> 				
> 			} catch (Exception e) {
> 				e.printStackTrace();
> 			}	
> 			
> 		}
> 		
> 		public static void main(String []args) {
> 			Client client = new Client();
> 			client.testProcess();
> 		}
> 		
> }
>
> -------------------------------------------------------------------------------------------------------
> The Person.java object representing the request element, is a simple
> JavaBean with name and address variables.
>
>
>
> What happens?
>
> When calling the BPEL process using this code, WSIF somehow mixes up the
> namespace of the Person object. A correct request message payload should be:
>
> <person xmlns="http://types.ciber.no"><name>John Doe</name><address>Mystreet
> 11</address></person></part>
>
> However, WSIF produces the following request object:
>
> <person><address>Mystreet 11</address><name>John Doe</name></person>
>
> As shown, WSIF omits the "http://types.ciber.no" namespace in the <person>
> elements. This results in an error since the BPEL process can't resolve the
> xpath expression /ns1:person/ns1:name or ns1:address
>
> This call was made using the 2.0.1_IB3 . The 2.0 version also fails.
>
> Does anyone have a clue what's happening here?
>   

hi Mario,

hard to say - it would be useful to confirm that AXIS1 when used alone
is ending the XML messages you want. you may also want to enable
tracing/logging in WSIF (and AXIS) to see what is going on.

if possible also please try the latest pre-release 2.1.0 version (it
should have more recent AXIS jar used) from

http://people.apache.org/dist/ws/wsif/

thanks,

alek

-- 
The best way to predict the future is to invent it - Alan Kay


---------------------------------------------------------------------
To unsubscribe, e-mail: wsif-user-unsubscribe@ws.apache.org
For additional commands, e-mail: wsif-user-help@ws.apache.org