You are viewing a plain text version of this content. The canonical link for it is here.
Posted to agila-user@incubator.apache.org by tn...@symcor.com on 2006/01/31 19:17:08 UTC

get back the response message

How do I can get the response message back?
In the bpel file, I have input, then I assign this input variable to
realInput variable and I use 2 ways invoke this realInput variable as
inputVariable and output variable as outputVariable.
in the client: I use for example:
org.w3c.dom.Document returnDoc = engineClient.acknowledge(
"converterLink", "Converter", "celsiusToFarenheit", new
DOMWriter().write(doc)); 
and I guest the returnDoc should be my output. Am I right? am I missing
anything? 
PS: in the Instance of Twister, I can see the output value and it is the
right value. How do I get this value back when I call acknowledge?

Thanks
Tu


Re: get back the response message

Posted by tn...@symcor.com.
Davide, thanks a lot for you help.  I think I am getting there.

Thanks
Tu


                                                                           
             Davide Ling                                                   
             <lingda@libero.it                                             
             >                                                          To 
                                       agila-user@incubator.apache.org     
             02/10/2006 02:20                                           cc 
             AM                                                            
                                                                   Subject 
                                       Re: get back the response message   
             Please respond to                                             
             agila-user@incuba                                             
              tor.apache.org                                               
                                                                           
                                                                           
                                                                           




On Friday 10 February 2006 04:26, tnguyen@symcor.com wrote:
> Davide,
>
> If you don't mind, could you send me the SOAPUtilityMethods class and the
> createXpathQuery code.
>

Excuse me for the delay, but at time You sent your mail It's 4:26 am here!
Ok, I'm happy to help You.


Here the createXPathQuery method I used for my test cases.
So written is not so much riusable, but You can modify it to pass
any namespaces. XPath needs namespaces if Your XML messages
has some namespace prefix in its elements.

Ah!.. As You can see it uses Jaxen.

private org.jaxen.XPath createXpathQuery(final String queryString)
        throws JaxenException {

        org.jaxen.XPath xpath = new DOMXPath(queryString);
        SimpleNamespaceContext namespace = new SimpleNamespaceContext();

        /* Insert your namespaces!!! */
        namespace.addNamespace("tn",
               "http://davideling.altervista.org/divisione-wsdl/");
        namespace.addNamespace("ns", "http://www.apache.org/agila");
        xpath.setNamespaceContext(namespace);

        return xpath;
    }

The SOAPMessageHandler class is allegated.

--
Davide Ling
Sito Personale - http://davideling.altervista.org
Key fingerprint = 284A 0FB9 F9F6 763C D429  E02B AA5D 483A 7E45 D2A6
(See attached file: SOAPMessageHandler.java)

Re: get back the response message

Posted by Davide Ling <li...@libero.it>.
On Friday 10 February 2006 04:26, tnguyen@symcor.com wrote:
> Davide,
>
> If you don't mind, could you send me the SOAPUtilityMethods class and the
> createXpathQuery code.
>

Excuse me for the delay, but at time You sent your mail It's 4:26 am here!
Ok, I'm happy to help You.


Here the createXPathQuery method I used for my test cases.
So written is not so much riusable, but You can modify it to pass
any namespaces. XPath needs namespaces if Your XML messages
has some namespace prefix in its elements.

Ah!.. As You can see it uses Jaxen.

private org.jaxen.XPath createXpathQuery(final String queryString)
        throws JaxenException {

        org.jaxen.XPath xpath = new DOMXPath(queryString);
        SimpleNamespaceContext namespace = new SimpleNamespaceContext();

        /* Insert your namespaces!!! */
        namespace.addNamespace("tn",
               "http://davideling.altervista.org/divisione-wsdl/");
        namespace.addNamespace("ns", "http://www.apache.org/agila");
        xpath.setNamespaceContext(namespace);

        return xpath;
    }

The SOAPMessageHandler class is allegated.

-- 
Davide Ling
Sito Personale - http://davideling.altervista.org
Key fingerprint = 284A 0FB9 F9F6 763C D429  E02B AA5D 483A 7E45 D2A6

Re: get back the response message

Posted by tn...@symcor.com.
Davide,

If you don't mind, could you send me the SOAPUtilityMethods class and the
createXpathQuery code.

Thanks
Tu


                                                                           
             Davide Ling                                                   
             <lingda@libero.it                                             
             >                                                          To 
                                       agila-user@incubator.apache.org     
             01/31/2006 03:16                                           cc 
             PM                                                            
                                                                   Subject 
                                       Re: get back the response message   
             Please respond to                                             
             agila-user@incuba                                             
              tor.apache.org                                               
                                                                           
                                                                           
                                                                           




On Tuesday 31 January 2006 20:17, tnguyen@symcor.com wrote:
> How do I can get the response message back?
> In the bpel file, I have input, then I assign this input variable to
> realInput variable and I use 2 ways invoke this realInput variable as
> inputVariable and output variable as outputVariable.
> in the client: I use for example:
> org.w3c.dom.Document returnDoc = engineClient.acknowledge(
> "converterLink", "Converter", "celsiusToFarenheit", new
> DOMWriter().write(doc));

I don't know if this can help You,
below I use the SAAJ API.
I get a SOAPMessage response.
and SOAPPart implements org.w3c.dom.Document interface

public void testSendMessage() throws Exception {

 URL serviceURL = new
URL("http://daltanius:8080/agila-ws/services/AgilaEngine");

 SOAPMessage response =
SOAPMessageHandler.sendSOAPMessage(orderSOAPMessage,
serviceURL);

 SOAPUtilityMethods.printSoapMessage(response);

 XPath xpath = createXpathQuery("//message/return-code/text()");

Iterator returnCodes = ((ArrayList)
xpath.evaluate(response.getSOAPPart())).iterator();

assertEquals("testSendMessage","0",
((TextImpl)returnCodes.next()).getData());
}


Bye
--
Davide Ling
Sito Personale - http://davideling.altervista.org
Key fingerprint = 284A 0FB9 F9F6 763C D429  E02B AA5D 483A 7E45 D2A6



Re: get back the response message

Posted by tn...@symcor.com.
Davide, thanks a lot for your help.

Tu


                                                                           
             Davide Ling                                                   
             <lingda@libero.it                                             
             >                                                          To 
                                       agila-user@incubator.apache.org     
             02/05/2006 05:24                                           cc 
             AM                                                            
                                                                   Subject 
                                       Re: get back the response message   
             Please respond to                                             
             agila-user@incuba                                             
              tor.apache.org                                               
                                                                           
                                                                           
                                                                           




Ehm... in the preceding mail the message to send has this schema

<xsd:complexType name="orderRegistrationMessageType">
                         <xsd:sequence>
                                                 <xsd:element name="name"
type="xsd:string" />
                                                 <xsd:element
name="surname" type="xsd:string" />
                                                 <xsd:element
name="address" type="tns:addressType" />
                                                 <xsd:element
name="itemList"

type="tns:itemListType" />
                                                 <xsd:element
name="shipMode" type="xsd:string" />
                                                 <xsd:element
name="taxNumber" type="xsd:string" />
                                                 <xsd:element
name="emailAddress" type="xsd:string" />
                         </xsd:sequence>
</xsd:complexType>

And I forgot to remove (in the headers creation section):
    SOAPHeader header = message.getSOAPHeader();
since method createHeaderElement doesn't need a SOAPHeader object
but needs a SOAPMessage object:

public void createHeaderElement(SOAPMessage message,
           String headerElementName, String prefix,
           String namespace, String headerElementText)
        throws SOAPException {

        SOAPHeader header = message.getSOAPHeader();
        SOAPHeaderElement operationElement =    header.addHeaderElement(

soapFactory.createName(headerElementName,prefix,namespace));
        operationElement.addTextNode(headerElementText);

    }

So ...

// ----------- Headers creation -------------
// ---NO--- SOAPHeader header = message.getSOAPHeader();
soapMessageHandler.createHeaderElement(message, "partner",
"tws",                   "http://www.apache.org/agila","orderingPL");
soapMessageHandler.createHeaderElement(message, "port",
"tws",                   "http://www.apache.org/agila","orderPT");
soapMessageHandler.createHeaderElement(message, "operation",
"tws",                   "http://www.apache.org/agila","sendOrder");
// ---------------------------------------------------

Sorry
--
Davide Ling
Sito Personale - http://davideling.altervista.org
Key fingerprint = 284A 0FB9 F9F6 763C D429  E02B AA5D 483A 7E45 D2A6



Re: get back the response message

Posted by tn...@symcor.com.
Davide,

Now, I move one step forward, I can connect to Agila, but I got Axis
exception:
[Agila] ERROR [http-8080-Processor23] AxisServlet.getSoapAction(1002) |
Generati
ng fault class
AxisFault
 faultCode: {http://xml.apache.org/axis/}Client.NoSOAPAction
 faultSubcode:
 faultString: no SOAPAction header!
 faultActor:
 faultNode:
 faultDetail:
        {http://xml.apache.org/axis/}stackTrace:no SOAPAction header!
        at
org.apache.axis.transport.http.AxisServlet.getSoapAction(AxisServlet.
java:997)
        at
org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:67
6)
They say, they need the SOAPAction header!

My project is that I have to use bpel engine to invoke the webservice.  I
use Axis 1.1 to create the webservice and WSDL file.  Fronm this WSDL, I
manually create the wsdldef file and bpel file.  I enclose it in here.

And here is the code that I send the soap message:
 public SOAPMessage createSOAPMessage(ArrayList exceptionList) throws
SOAPException {

      MessageFactory messageFactory = MessageFactory.newInstance();
        SOAPMessage message = messageFactory.createMessage();
        try {

       // SOAPFactory soapFactory = SOAPFactory.newInstance();

        SOAPMessageHandler soapMessageHandler = new SOAPMessageHandler();

        // ----------- Headers creation -------------
        //SOAPHeader header = message.getSOAPHeader();

        soapMessageHandler.createHeaderElement(message, "partner", "tws",
                   "http://www.apache.org/agila","exceptionservice");
        soapMessageHandler.createHeaderElement(message, "port", "tws",
                   "http://www.apache.org/agila","ExceptionService");
        soapMessageHandler.createHeaderElement(message, "operation", "tws",
                   "http://www.apache.org/agila","processExceptionItems");
        // ---------------------------------------------------

        SOAPBody body = message.getSOAPBody();

        SOAPElement proExMessageElement =
             soapMessageHandler.createIntermediateNode(body , "message",
                     "tn","http://www.symcor.com/tecp");

        SOAPElement exceptionListRequest =
            soapMessageHandler.createIntermediateNode(proExMessageElement,
"summaries");
        Iterator iterator = exceptionList.iterator();

        SearchResultSummary summary;
        SOAPElement itemSOAPElement;
        while (iterator.hasNext()) {
            summary = (SearchResultSummary)iterator.next();
            itemSOAPElement =
soapMessageHandler.createIntermediateNode(exceptionListRequest,
"SearchResultSummary");
            soapMessageHandler.createTextSOAPElement(itemSOAPElement,
"account", summary.getAccount());
            soapMessageHandler.createTextSOAPElement(itemSOAPElement,
"amount", String.valueOf(summary.getAmount()));
            soapMessageHandler.createTextSOAPElement(itemSOAPElement,
"exceptionDate", String.valueOf(summary.getExceptionDate()));
            soapMessageHandler.createTextSOAPElement(itemSOAPElement, "fi",
summary.getFi());
            soapMessageHandler.createTextSOAPElement(itemSOAPElement,
"mailTransit", summary.getMailTransit());
            soapMessageHandler.createTextSOAPElement(itemSOAPElement,
"reasonCode", summary.getReasonCode());
            soapMessageHandler.createTextSOAPElement(itemSOAPElement,
"sequence", summary.getSequence());
            soapMessageHandler.createTextSOAPElement(itemSOAPElement,
"transitID", summary.getTransitID());
            soapMessageHandler.createTextSOAPElement(itemSOAPElement,
"SLA", "");
            soapMessageHandler.createTextSOAPElement(itemSOAPElement,
"completionDate", "0");

        }

        message.saveChanges();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return message;
    }

       public ArrayList invokeExceptionService(ArrayList exceptionList)
throws WIRApplicationException{

      try {
            URL url = new
URL("http://localhost:8080/agila-ws/services/AgilaEngine");
            SOAPMessage sendMessage = createSOAPMessage (exceptionList);
            SOAPMessage returnMessage =
SOAPMessageHandler.sendSOAPMessage(sendMessage, url);


      } catch (Exception e){
            e.printStackTrace();
      }
            return exceptionList;
}

Please give me any suggestions?

Thanks
Tu(See attached file: ExceptionService.wsdl)(See attached file:
tecpbpel.bpel)(See attached file: tecpbpel.wsdl)




                                                                           
             Davide Ling                                                   
             <lingda@libero.it                                             
             >                                                          To 
                                       agila-user@incubator.apache.org     
             02/05/2006 03:07                                           cc 
             PM                                                            
                                                                   Subject 
                                       Re: get back the response message   
             Please respond to                                             
             agila-user@incuba                                             
              tor.apache.org                                               
                                                                           
                                                                           
                                                                           




On Sunday 05 February 2006 20:08, tnguyen@symcor.com wrote:
> Davidee,
>
> I try to send this soap message, but I got this exception:
> Feb 5, 2006 2:00:19 PM com.sun.xml.messaging.saaj.soap.MessageImpl
> saveChanges
> SEVERE: SAAJ0540: Error during saving a multipart message
> com.sun.xml.messaging.saaj.SOAPExceptionImpl: Error during saving a
> multipart me

Below is a simple client (non agila client) that send a messege like this:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
 <guy>
  <name>Davide</name>
  <surname>Ling</surname>
 </guy>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

And receive a message like this (from a servlet):
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
  <response>Hello Davide Ling</response>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

import java.net.URL;

import javax.xml.soap.MessageFactory;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.SOAPConnectionFactory;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPFactory;
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPMessage;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;

public class Main {
             public static void main(String[] args) throws Exception {
                         SOAPFactory soapFactory =
SOAPFactory.newInstance();

                         MessageFactory mf = MessageFactory.newInstance();
                         SOAPMessage msg = mf.createMessage();
                         SOAPBody body = msg.getSOAPBody();
                         // You can detach the SOAP header in this example
                         // msg.getSOAPHeader().detachNode();

                         Name guyName = soapFactory.createName("guy");
                         SOAPElement guyElement =
body.addBodyElement(guyName);

                         SOAPElement child =
soapFactory.createElement("name");
                         child.addTextNode("Davide");
                         guyElement.addChildElement(child);

                         child = soapFactory.createElement("surname");
                         child.addTextNode("Ling");
                         guyElement.addChildElement(child);

                         msg.saveChanges();

                         // Create the connection
                         SOAPConnectionFactory scf =
                                     SOAPConnectionFactory.newInstance();
                                     SOAPConnection con =
scf.createConnection();

                         // Send the message
                         System.out.println("Send the SOAP message\n");
                         URL endpoint = new URL("
http://localhost:8080/SOAPServlet/SOAP");
                         SOAPMessage response = con.call(msg,endpoint);

                         // Print sent message
                         System.out.println("Sent:");
                         Transformer trans =
TransformerFactory.newInstance().newTransformer();
                         trans.transform(new
DOMSource(msg.getSOAPPart()),new
StreamResult(System.out));

                         // Print response message
                         System.out.println("\n\nReceived:");
                         trans.transform(new
DOMSource(response.getSOAPPart()),new
StreamResult(System.out));
             }
}

Bye
--
Davide Ling
Sito Personale - http://davideling.altervista.org
Key fingerprint = 284A 0FB9 F9F6 763C D429  E02B AA5D 483A 7E45 D2A6

Re: get back the response message

Posted by Davide Ling <li...@libero.it>.
On Sunday 05 February 2006 20:08, tnguyen@symcor.com wrote:
> Davidee,
>
> I try to send this soap message, but I got this exception:
> Feb 5, 2006 2:00:19 PM com.sun.xml.messaging.saaj.soap.MessageImpl
> saveChanges
> SEVERE: SAAJ0540: Error during saving a multipart message
> com.sun.xml.messaging.saaj.SOAPExceptionImpl: Error during saving a
> multipart me

Below is a simple client (non agila client) that send a messege like this:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
 <guy>
  <name>Davide</name>
  <surname>Ling</surname>
 </guy>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

And receive a message like this (from a servlet):
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
  <response>Hello Davide Ling</response>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

import java.net.URL; 
 
import javax.xml.soap.MessageFactory; 
import javax.xml.soap.Name; 
import javax.xml.soap.SOAPBody; 
import javax.xml.soap.SOAPConnection; 
import javax.xml.soap.SOAPConnectionFactory; 
import javax.xml.soap.SOAPElement; 
import javax.xml.soap.SOAPFactory; 
import javax.xml.soap.SOAPHeader; 
import javax.xml.soap.SOAPMessage; 
import javax.xml.transform.Transformer; 
import javax.xml.transform.TransformerFactory; 
import javax.xml.transform.dom.DOMSource; 
import javax.xml.transform.stream.StreamResult; 
 
public class Main { 
	public static void main(String[] args) throws Exception { 
		SOAPFactory soapFactory = SOAPFactory.newInstance(); 
 
		MessageFactory mf = MessageFactory.newInstance(); 
		SOAPMessage msg = mf.createMessage(); 
		SOAPBody body = msg.getSOAPBody(); 
		// You can detach the SOAP header in this example
		// msg.getSOAPHeader().detachNode(); 
		 
		Name guyName = soapFactory.createName("guy"); 
		SOAPElement guyElement = body.addBodyElement(guyName); 
		 
		SOAPElement child = soapFactory.createElement("name"); 
		child.addTextNode("Davide"); 
		guyElement.addChildElement(child); 
		 
		child = soapFactory.createElement("surname"); 
		child.addTextNode("Ling"); 
		guyElement.addChildElement(child); 
		 
		msg.saveChanges(); 
		 
		// Create the connection
		SOAPConnectionFactory scf =  
			SOAPConnectionFactory.newInstance(); 
			SOAPConnection con = scf.createConnection(); 
			 
		// Send the message
		System.out.println("Send the SOAP message\n"); 
		URL endpoint = new URL("http://localhost:8080/SOAPServlet/SOAP"); 
		SOAPMessage response = con.call(msg,endpoint); 
		 
		// Print sent message
		System.out.println("Sent:"); 
		Transformer trans = TransformerFactory.newInstance().newTransformer(); 
		trans.transform(new DOMSource(msg.getSOAPPart()),new 
StreamResult(System.out)); 
		 
		// Print response message
		System.out.println("\n\nReceived:"); 
		trans.transform(new DOMSource(response.getSOAPPart()),new 
StreamResult(System.out)); 
	} 
}

Bye
-- 
Davide Ling
Sito Personale - http://davideling.altervista.org
Key fingerprint = 284A 0FB9 F9F6 763C D429  E02B AA5D 483A 7E45 D2A6

Re: get back the response message

Posted by Davide Ling <li...@libero.it>.
On Sunday 05 February 2006 20:08, tnguyen@symcor.com wrote:
> I don't need to create the multipart, but it give me the error.  What
> version of saaj and what jdk you are using?  I used the jdk 1.5, and the
> saaj 1.3 (because it either has runtime exception or compile errors if I
> use different version).  

Which compile errors?

-- 
Davide Ling
Sito Personale - http://davideling.altervista.org
Key fingerprint = 284A 0FB9 F9F6 763C D429  E02B AA5D 483A 7E45 D2A6

Re: get back the response message

Posted by tn...@symcor.com.
Hey, this my problem, the array type in Axis.

In the webservice, have a method which has array object.  Using Axis to
deploy the service, we have array type in the wsdl:
 <complexType name="SearchResultSummary">
    <sequence>
     <element name="amount" type="xsd:double"/>
     <element name="SLA" nillable="true" type="xsd:string"/>
     <element name="exceptionDate" type="xsd:long"/>
     <element name="reasonCode" nillable="true" type="xsd:string"/>
     <element name="transitID" nillable="true" type="xsd:string"/>
     <element name="fi" nillable="true" type="xsd:string"/>
     <element name="account" nillable="true" type="xsd:string"/>
     <element name="mailTransit" nillable="true" type="xsd:string"/>
     <element name="sequence" nillable="true" type="xsd:string"/>
     <element name="completionDate" type="xsd:long"/>
    </sequence>
   </complexType>
  </schema>
  <schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://ws.wir.symcor.com">
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="ArrayOf_tns2_SearchResultSummary">
    <complexContent>
     <restriction base="soapenc:Array">
      <attribute ref="soapenc:arrayType"
wsdl:arrayType="tns2:SearchResultSummary[]"/>
     </restriction>
    </complexContent>
   </complexType>
  </schema>

So, I use the Axis tcpmonitor, I can see they construct a request like
this:
<?xml version="1.0" encoding="UTF-8"?>
<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>
  <ns1:processExceptionItems
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://ws.wir.symcor.com">
   <summaryArray href="#id0"/>
  </ns1:processExceptionItems>
  <multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:SearchResultSummaryArray"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="http://summary.value.biz.wir.symcor.com">
   <searchResultSummaries xsi:type="soapenc:Array"
soapenc:arrayType="ns2:SearchResultSummary[1]">
    <item href="#id1"/>
   </searchResultSummaries>
  </multiRef>
  <multiRef id="id1" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns3:SearchResultSummary"
xmlns:ns3="http://summary.value.biz.wir.symcor.com"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
   <SLA xsi:type="xsd:string" xsi:nil="true"/>
   <account xsi:type="xsd:string">0001020023</account>
   <amount xsi:type="xsd:double">400.0</amount>
   <completionDate xsi:type="xsd:long">0</completionDate>
   <exceptionDate xsi:type="xsd:long">1106283600000</exceptionDate>
   <fi xsi:type="xsd:string">003</fi>
   <mailTransit xsi:type="xsd:string">00002</mailTransit>
   <reasonCode xsi:type="xsd:string">NSF</reasonCode>
   <sequence xsi:type="xsd:string">0500026290</sequence>
   <transitID xsi:type="xsd:string">00002</transitID>
  </multiRef>
 </soapenv:Body>
</soapenv:Envelope>

The problem is how do we construct the Envelope with the multiRef type to
send to AgilaEngine to invoke this webservice???

Please helps,

Thanks
Tu




                                                                           
             Davide Ling                                                   
             <lingda@libero.it                                             
             >                                                          To 
                                       agila-user@incubator.apache.org     
             02/05/2006 03:45                                           cc 
             PM                                                            
                                                                   Subject 
                                       Re: get back the response message   
             Please respond to                                             
             agila-user@incuba                                             
              tor.apache.org                                               
                                                                           
                                                                           
                                                                           




On Sunday 05 February 2006 21:17, tnguyen@symcor.com wrote:
> Davide,  thanks a lots.  It was class not  found (the xalan lib) and I
got
> it work.  Thanks.

I'm happy for You.

Bye

--
Davide Ling
Sito Personale - http://davideling.altervista.org
Key fingerprint = 284A 0FB9 F9F6 763C D429  E02B AA5D 483A 7E45 D2A6



Re: get back the response message

Posted by Davide Ling <li...@libero.it>.
On Sunday 05 February 2006 21:17, tnguyen@symcor.com wrote:
> Davide,  thanks a lots.  It was class not  found (the xalan lib) and I got
> it work.  Thanks.

I'm happy for You.

Bye

-- 
Davide Ling
Sito Personale - http://davideling.altervista.org
Key fingerprint = 284A 0FB9 F9F6 763C D429  E02B AA5D 483A 7E45 D2A6

Re: get back the response message

Posted by tn...@symcor.com.
Davide,  thanks a lots.  It was class not  found (the xalan lib) and I got
it work.  Thanks.

Tu


                                                                           
             Davide Ling                                                   
             <lingda@libero.it                                             
             >                                                          To 
                                       agila-user@incubator.apache.org     
             02/05/2006 02:57                                           cc 
             PM                                                            
                                                                   Subject 
                                       Re: get back the response message   
             Please respond to                                             
             agila-user@incuba                                             
              tor.apache.org                                               
                                                                           
                                                                           
                                                                           




On Sunday 05 February 2006 20:08, tnguyen@symcor.com wrote:
> I try to send this soap message, but I got this exception:
> Feb 5, 2006 2:00:19 PM com.sun.xml.messaging.saaj.soap.MessageImpl
> saveChanges
> SEVERE: SAAJ0540: Error during saving a multipart message
> com.sun.xml.messaging.saaj.SOAPExceptionImpl: Error during saving a

If You post your code maybe I can do something to help You  ;)

--
Davide Ling
Sito Personale - http://davideling.altervista.org
Key fingerprint = 284A 0FB9 F9F6 763C D429  E02B AA5D 483A 7E45 D2A6



Re: get back the response message

Posted by Davide Ling <li...@libero.it>.
On Sunday 05 February 2006 20:08, tnguyen@symcor.com wrote:
> I try to send this soap message, but I got this exception:
> Feb 5, 2006 2:00:19 PM com.sun.xml.messaging.saaj.soap.MessageImpl
> saveChanges
> SEVERE: SAAJ0540: Error during saving a multipart message
> com.sun.xml.messaging.saaj.SOAPExceptionImpl: Error during saving a

If You post your code maybe I can do something to help You  ;)

-- 
Davide Ling
Sito Personale - http://davideling.altervista.org
Key fingerprint = 284A 0FB9 F9F6 763C D429  E02B AA5D 483A 7E45 D2A6

Re: get back the response message

Posted by Davide Ling <li...@libero.it>.
On Sunday 05 February 2006 20:08, tnguyen@symcor.com wrote
> I don't need to create the multipart, but it give me the error.  What
> version of saaj and what jdk you are using?  I used the jdk 1.5, and the
> saaj 1.3 (because it either has runtime exception or compile errors if I
> use different version).  Is Saaj 1.3 need us to add the multipart message?

I used SAAJ 1.2.2 (in JWSDP 1.6) and jdk1.5

Remember, often You need other jar files from JWSDP

-- 
Davide Ling
Sito Personale - http://davideling.altervista.org
Key fingerprint = 284A 0FB9 F9F6 763C D429  E02B AA5D 483A 7E45 D2A6

Re: get back the response message

Posted by tn...@symcor.com.
Davidee,

I try to send this soap message, but I got this exception:
Feb 5, 2006 2:00:19 PM com.sun.xml.messaging.saaj.soap.MessageImpl
saveChanges
SEVERE: SAAJ0540: Error during saving a multipart message
com.sun.xml.messaging.saaj.SOAPExceptionImpl: Error during saving a
multipart me
ssage
        at
com.sun.xml.messaging.saaj.soap.MessageImpl.saveChanges(MessageImpl.j
ava:1104)
        at
com.symcor.wir.delegate.ESBDelegate.createSOAPMessage(ESBDelegate.jav
a:123)
        at
com.symcor.wir.delegate.ESBDelegate.invokeExceptionService(ESBDelegat
e.java:134)
        at
com.symcor.wir.web.actions.SubmitESBAction.onExecute(SubmitESBAction.
java:95)

I don't need to create the multipart, but it give me the error.  What
version of saaj and what jdk you are using?  I used the jdk 1.5, and the
saaj 1.3 (because it either has runtime exception or compile errors if I
use different version).  Is Saaj 1.3 need us to add the multipart message?

Thanks
Tu


                                                                           
             Davide Ling                                                   
             <lingda@libero.it                                             
             >                                                          To 
                                       agila-user@incubator.apache.org     
             02/05/2006 05:24                                           cc 
             AM                                                            
                                                                   Subject 
                                       Re: get back the response message   
             Please respond to                                             
             agila-user@incuba                                             
              tor.apache.org                                               
                                                                           
                                                                           
                                                                           




Ehm... in the preceding mail the message to send has this schema

<xsd:complexType name="orderRegistrationMessageType">
                         <xsd:sequence>
                                                 <xsd:element name="name"
type="xsd:string" />
                                                 <xsd:element
name="surname" type="xsd:string" />
                                                 <xsd:element
name="address" type="tns:addressType" />
                                                 <xsd:element
name="itemList"

type="tns:itemListType" />
                                                 <xsd:element
name="shipMode" type="xsd:string" />
                                                 <xsd:element
name="taxNumber" type="xsd:string" />
                                                 <xsd:element
name="emailAddress" type="xsd:string" />
                         </xsd:sequence>
</xsd:complexType>

And I forgot to remove (in the headers creation section):
    SOAPHeader header = message.getSOAPHeader();
since method createHeaderElement doesn't need a SOAPHeader object
but needs a SOAPMessage object:

public void createHeaderElement(SOAPMessage message,
           String headerElementName, String prefix,
           String namespace, String headerElementText)
        throws SOAPException {

        SOAPHeader header = message.getSOAPHeader();
        SOAPHeaderElement operationElement =    header.addHeaderElement(

soapFactory.createName(headerElementName,prefix,namespace));
        operationElement.addTextNode(headerElementText);

    }

So ...

// ----------- Headers creation -------------
// ---NO--- SOAPHeader header = message.getSOAPHeader();
soapMessageHandler.createHeaderElement(message, "partner",
"tws",                   "http://www.apache.org/agila","orderingPL");
soapMessageHandler.createHeaderElement(message, "port",
"tws",                   "http://www.apache.org/agila","orderPT");
soapMessageHandler.createHeaderElement(message, "operation",
"tws",                   "http://www.apache.org/agila","sendOrder");
// ---------------------------------------------------

Sorry
--
Davide Ling
Sito Personale - http://davideling.altervista.org
Key fingerprint = 284A 0FB9 F9F6 763C D429  E02B AA5D 483A 7E45 D2A6



Re: get back the response message

Posted by Davide Ling <li...@libero.it>.
Ehm... in the preceding mail the message to send has this schema

<xsd:complexType name="orderRegistrationMessageType">
		<xsd:sequence>
				<xsd:element name="name" type="xsd:string" />
				<xsd:element name="surname" type="xsd:string" />
				<xsd:element name="address" type="tns:addressType" />
				<xsd:element name="itemList"
					type="tns:itemListType" />
				<xsd:element name="shipMode" type="xsd:string" />
				<xsd:element name="taxNumber" type="xsd:string" />
				<xsd:element name="emailAddress" type="xsd:string" />
		</xsd:sequence>
</xsd:complexType>

And I forgot to remove (in the headers creation section):
    SOAPHeader header = message.getSOAPHeader();
since method createHeaderElement doesn't need a SOAPHeader object
but needs a SOAPMessage object:

public void createHeaderElement(SOAPMessage message,
           String headerElementName, String prefix,
           String namespace, String headerElementText)
        throws SOAPException {

        SOAPHeader header = message.getSOAPHeader();
        SOAPHeaderElement operationElement =    header.addHeaderElement(
                 soapFactory.createName(headerElementName,prefix,namespace));
        operationElement.addTextNode(headerElementText);

    }

So ...

// ----------- Headers creation -------------
// ---NO--- SOAPHeader header = message.getSOAPHeader();
            
soapMessageHandler.createHeaderElement(message, "partner", "tws",
                   "http://www.apache.org/agila","orderingPL");
soapMessageHandler.createHeaderElement(message, "port", "tws",
                   "http://www.apache.org/agila","orderPT");
soapMessageHandler.createHeaderElement(message, "operation", "tws",
                   "http://www.apache.org/agila","sendOrder");
// ---------------------------------------------------

Sorry
-- 
Davide Ling
Sito Personale - http://davideling.altervista.org
Key fingerprint = 284A 0FB9 F9F6 763C D429  E02B AA5D 483A 7E45 D2A6

Re: sample of bpel file

Posted by Matthieu Riou <ma...@gmail.com>.
Yep, you're right Davide.

Cheers,

Matthieu.

On 2/7/06, Davide Ling <li...@libero.it> wrote:
> tnguyen@symcor.com wrote:
>
> >So is this should work?
> >
> ><sequence name="main">
> >            <!-- Receive input from requestor.
> >             Note: This maps to operation defined in tecpbpel.wsdl
> >             -->
> >            <receive name="receiveInput" partnerLink="tecp"
> >portType="tns:tecpbpel" operation="initiate" variable="receiveInput"
> >createInstance="yes">
> >            </receive>
> >            <assign>
> >                  <copy>
> >                        <from variable="receiveInput"></from>
> >                        <to variable="input"></to>
> >                  </copy>
> >            </assign>
> >
> >            <invoke name="callExceptionService"
> >partnerLink="exceptionservice" portType="tns:ExceptionService"
> >operation="tns:processExceptionItem" inputVariable="input"
> >outputVariable="output">
> >            </invoke>
> >
> >            <reply name="reply" partnerLink="returntecp"
> >portType="tns:ExceptionService" operation="tns:processExceptionItem"
> >variable="output">
> >            </reply>
> >      </sequence>
> >
> >
> >I send the receiveInput variable to the engine, then assign it to input
> >variable  and invoke webservice with input as input variable and and output
> >as output variable.  Finally reply this variable back.  Do I have to define
> >the portType for this reply, if so is this a LocalPort (like the initiator
> >port)? how about the operation and th partnerLink?
> >
> >
> >
> Hi.
> Looking your process I realize that the invoke is on a two-way
> syncronous operation (input and output variable).
>
> I think If you want to send back the output variable to who called the
> Agila engine
>  the reply partnerLink has to be the same as the receive one (tecp).
>
> I see PartnerLinks as logical connection wires.
>
> Matthieu, Is it true? ;)
>
> Bye
> --
> Davide
>

Re: sample of bpel file

Posted by Davide Ling <li...@libero.it>.
tnguyen@symcor.com wrote:

>So is this should work?
>
><sequence name="main">
>            <!-- Receive input from requestor.
>             Note: This maps to operation defined in tecpbpel.wsdl
>             -->
>            <receive name="receiveInput" partnerLink="tecp"
>portType="tns:tecpbpel" operation="initiate" variable="receiveInput"
>createInstance="yes">
>            </receive>
>            <assign>
>                  <copy>
>                        <from variable="receiveInput"></from>
>                        <to variable="input"></to>
>                  </copy>
>            </assign>
>
>            <invoke name="callExceptionService"
>partnerLink="exceptionservice" portType="tns:ExceptionService"
>operation="tns:processExceptionItem" inputVariable="input"
>outputVariable="output">
>            </invoke>
>
>            <reply name="reply" partnerLink="returntecp"
>portType="tns:ExceptionService" operation="tns:processExceptionItem"
>variable="output">
>            </reply>
>      </sequence>
>
>
>I send the receiveInput variable to the engine, then assign it to input
>variable  and invoke webservice with input as input variable and and output
>as output variable.  Finally reply this variable back.  Do I have to define
>the portType for this reply, if so is this a LocalPort (like the initiator
>port)? how about the operation and th partnerLink?
>
>  
>
Hi.
Looking your process I realize that the invoke is on a two-way 
syncronous operation (input and output variable).

I think If you want to send back the output variable to who called the 
Agila engine
 the reply partnerLink has to be the same as the receive one (tecp).

I see PartnerLinks as logical connection wires.

Matthieu, Is it true? ;)

Bye
--
Davide

Re: sample of bpel file

Posted by tn...@symcor.com.
So is this should work?

<sequence name="main">
            <!-- Receive input from requestor.
             Note: This maps to operation defined in tecpbpel.wsdl
             -->
            <receive name="receiveInput" partnerLink="tecp"
portType="tns:tecpbpel" operation="initiate" variable="receiveInput"
createInstance="yes">
            </receive>
            <assign>
                  <copy>
                        <from variable="receiveInput"></from>
                        <to variable="input"></to>
                  </copy>
            </assign>

            <invoke name="callExceptionService"
partnerLink="exceptionservice" portType="tns:ExceptionService"
operation="tns:processExceptionItem" inputVariable="input"
outputVariable="output">
            </invoke>

            <reply name="reply" partnerLink="returntecp"
portType="tns:ExceptionService" operation="tns:processExceptionItem"
variable="output">
            </reply>
      </sequence>


I send the receiveInput variable to the engine, then assign it to input
variable  and invoke webservice with input as input variable and and output
as output variable.  Finally reply this variable back.  Do I have to define
the portType for this reply, if so is this a LocalPort (like the initiator
port)? how about the operation and th partnerLink?


Thanks
Tu


                                                                           
             Matthieu Riou                                                 
             <matthieu.riou@gm                                             
             ail.com>                                                   To 
                                       agila-user@incubator.apache.org     
             02/07/2006 11:54                                           cc 
             AM                                                            
                                                                   Subject 
                                       Re: sample of bpel file             
             Please respond to                                             
             agila-user@incuba                                             
              tor.apache.org                                               
                                                                           
                                                                           
                                                                           




You'll have to use a receive / reply sequence. First your web app
sends a message to the engine, the reception of this message is
handled by a receive. Then you invoke your web service, use the web
service output variable and return it in a reply. So your process
should look like this:

sequence
   receive
   invoke
   reply

Matthieu.

>I want my process reply to the second receive.I'm new to bpel,  I
just want a simple bpel that work the same way as Ihave a web, the web
call the bpel engine, and the bpel engine invoke awebserivice and
return for me the response and I need this response as theoutput back
to the web.If I don't use bpel Engine, I could call this webservice
directly.  (Butthe requirement that I need to use bpel engine to
invoke a webservice).Any suggestions?ThanksTu             Davide Ling
           <lingda@libero.it             >
                             To
agila-user@incubator.apache.org             02/06/2006 06:50
                                cc             PM
                                             Subject
                    Re: sample of bpel file             Please respond
to             agila-user@incuba              tor.apache.org- Show
quoted text -On Monday 06 February 2006 23:49, tnguyen@symcor.com
wrote:>             <receive nameu003d"receive"
partnerLinku003d"returntecp"> portTypeu003d"tns:returntecp"
operationu003d"process" variableu003d"receiveOutput" >>
</receive>>             <reply nameu003d"reply"
partnerLinku003d"returntecp"> portTypeu003d"tns:returntecp"
operationu003d"process" variableu003d"receiveOutput">>
</reply>>       </sequence>> </process>I don't understand , who call
the initiate operation?Last reply is for the second receive
(partnerLink "returntecp").This process works only if some client
first invoke the "initiate"operationon "tecp" partnerLink. Otherwise
no istance woud be created.Do You want your process reply to the first
receive or the second one?(I'm sorry, in Italy it's tool late now! I
go to bed! Bye!)--Davide LingSito Personale -
http://davideling.altervista.orgKey fingerprint u003d 284A 0FB9 F9F6
763C D429  E02B AA5D 483A 7E45 D2A6



Re: sample of bpel file

Posted by Matthieu Riou <ma...@gmail.com>.
You'll have to use a receive / reply sequence. First your web app
sends a message to the engine, the reception of this message is
handled by a receive. Then you invoke your web service, use the web
service output variable and return it in a reply. So your process
should look like this:

sequence
   receive
   invoke
   reply

Matthieu.

>I want my process reply to the second receive.I'm new to bpel,  I
just want a simple bpel that work the same way as Ihave a web, the web
call the bpel engine, and the bpel engine invoke awebserivice and
return for me the response and I need this response as theoutput back
to the web.If I don't use bpel Engine, I could call this webservice
directly.  (Butthe requirement that I need to use bpel engine to
invoke a webservice).Any suggestions?ThanksTu             Davide Ling 
           <lingda@libero.it             >                            
                             To                                      
agila-user@incubator.apache.org             02/06/2006 06:50          
                                cc             PM                     
                                             Subject                  
                    Re: sample of bpel file             Please respond
to             agila-user@incuba              tor.apache.org- Show
quoted text -On Monday 06 February 2006 23:49, tnguyen@symcor.com
wrote:>             <receive nameu003d"receive"
partnerLinku003d"returntecp"> portTypeu003d"tns:returntecp"
operationu003d"process" variableu003d"receiveOutput" >>            
</receive>>             <reply nameu003d"reply"
partnerLinku003d"returntecp"> portTypeu003d"tns:returntecp"
operationu003d"process" variableu003d"receiveOutput">>            
</reply>>       </sequence>> </process>I don't understand , who call
the initiate operation?Last reply is for the second receive
(partnerLink "returntecp").This process works only if some client
first invoke the "initiate"operationon "tecp" partnerLink. Otherwise
no istance woud be created.Do You want your process reply to the first
receive or the second one?(I'm sorry, in Italy it's tool late now! I
go to bed! Bye!)--Davide LingSito Personale -
http://davideling.altervista.orgKey fingerprint u003d 284A 0FB9 F9F6
763C D429  E02B AA5D 483A 7E45 D2A6

Re: sample of bpel file

Posted by tn...@symcor.com.
I want my process reply to the second receive.

I'm new to bpel,  I just want a simple bpel that work the same way as I
have a web, the web call the bpel engine, and the bpel engine invoke a
webserivice and return for me the response and I need this response as the
output back to the web.

If I don't use bpel Engine, I could call this webservice directly.  (But
the requirement that I need to use bpel engine to invoke a webservice).

Any suggestions?

Thanks
Tu




                                                                           
             Davide Ling                                                   
             <lingda@libero.it                                             
             >                                                          To 
                                       agila-user@incubator.apache.org     
             02/06/2006 06:50                                           cc 
             PM                                                            
                                                                   Subject 
                                       Re: sample of bpel file             
             Please respond to                                             
             agila-user@incuba                                             
              tor.apache.org                                               
                                                                           
                                                                           
                                                                           




On Monday 06 February 2006 23:49, tnguyen@symcor.com wrote:
>             <receive name="receive" partnerLink="returntecp"
> portType="tns:returntecp" operation="process" variable="receiveOutput" >
>             </receive>
>             <reply name="reply" partnerLink="returntecp"
> portType="tns:returntecp" operation="process" variable="receiveOutput">
>             </reply>
>       </sequence>
> </process>

I don't understand , who call the initiate operation?

Last reply is for the second receive (partnerLink "returntecp").

This process works only if some client first invoke the "initiate"
operation
on "tecp" partnerLink. Otherwise no istance woud be created.

Do You want your process reply to the first receive or the second one?

(I'm sorry, in Italy it's tool late now! I go to bed! Bye!)
--
Davide Ling
Sito Personale - http://davideling.altervista.org
Key fingerprint = 284A 0FB9 F9F6 763C D429  E02B AA5D 483A 7E45 D2A6



Re: sample of bpel file

Posted by Davide Ling <li...@libero.it>.
On Monday 06 February 2006 23:49, tnguyen@symcor.com wrote:
>             <receive name="receive" partnerLink="returntecp"
> portType="tns:returntecp" operation="process" variable="receiveOutput" >
>             </receive>
>             <reply name="reply" partnerLink="returntecp"
> portType="tns:returntecp" operation="process" variable="receiveOutput">
>             </reply>
>       </sequence>
> </process>

I don't understand , who call the initiate operation?

Last reply is for the second receive (partnerLink "returntecp").

This process works only if some client first invoke the "initiate" operation
on "tecp" partnerLink. Otherwise no istance woud be created.

Do You want your process reply to the first receive or the second one?

(I'm sorry, in Italy it's tool late now! I go to bed! Bye!)
-- 
Davide Ling
Sito Personale - http://davideling.altervista.org
Key fingerprint = 284A 0FB9 F9F6 763C D429  E02B AA5D 483A 7E45 D2A6

sample of bpel file

Posted by tn...@symcor.com.
I would like to send a message (an object)  to the AgilaEngine, and then
the AgilaEngine invoke a webservice and reply back the response (the output
of the return of the invoke call)  to me.  How do I do  this?  Is this
right?

<!-- tecpbpel BPEL Process [Generated by the Oracle BPEL Designer]  -->
<process name="tecpbpel"
targetNamespace="http://www.symcor.com/tecp/process"
suppressJoinFailure="yes" xmlns:tns="http://www.symcor.com/tecp/definition"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
      <!--
================================================================= -->
      <!-- PARTNERLINKS
-->
      <!-- List of services participating in this BPEL process
-->
      <!--
================================================================= -->
      <partnerLinks>
            <!--
        The 'client' role represents the requester of this service. It is
        used for callback. The location and correlation information
associated
        with the client role are automatically set using WS-Addressing.
        -->

            <partnerLink name="tecp" partnerLinkType="tns:tecpbpel"
myRole="initiator"/>
            <partnerLink name="exceptionservice"
partnerLinkType="tns:exceptionService" myRole="handleException"/>
            <partnerLink name="returntecp" partnerLinkType="tns:returntecp"
myRole="returntecp"/>
      </partnerLinks>
      <!--
================================================================= -->
      <!-- VARIABLES
-->
      <!-- List of messages and XML documents used within this BPEL process
-->
      <!--
================================================================= -->
      <variables>
            <!-- Reference to the message passed as input during initiation
-->
            <variable name="receiveInput" messageType="tns:inputRequest"/>
            <variable name="input"
messageType="tns:processExceptionItemsRequest"/>
            <variable name="output"
messageType="tns:processExceptionItemsResponse"/>
            <variable name="receiveOutput" messageType="tns:inputRequest"/>
      </variables>
      <!--
================================================================= -->
      <!-- ORCHESTRATION LOGIC
-->
      <!-- Set of activities coordinating the flow of messages across the
-->
      <!-- services integrated within this business process
-->
      <!--
================================================================= -->
      <sequence name="main">
            <!-- Receive input from requestor.
             Note: This maps to operation defined in tecpbpel.wsdl
             -->
            <receive name="receiveInput" partnerLink="tecp"
portType="tns:tecpbpel" operation="initiate" variable="receiveInput"
createInstance="yes">
            </receive>
            <assign>
                  <copy>
                        <from variable="receiveInput"></from>
                        <to variable="input"></to>
                  </copy>
            </assign>

            <invoke name="callExceptionService"
partnerLink="exceptionservice" portType="tns:ExceptionService"
operation="tns:processExceptionItem" inputVariable="input"
outputVariable="output">
            </invoke>
            <assign>
                  <copy>
                        <from variable="output"></from>
                        <to variable="receiveOutput"></to>
                  </copy>
            </assign>
            <receive name="receive" partnerLink="returntecp"
portType="tns:returntecp" operation="process" variable="receiveOutput" >
            </receive>
            <reply name="reply" partnerLink="returntecp"
portType="tns:returntecp" operation="process" variable="receiveOutput">
            </reply>
      </sequence>
</process>


Any suggestions?

Thanks
u



Re: get back the response message

Posted by Davide Ling <li...@libero.it>.
On Monday 06 February 2006 09:11, Davide Ling wrote:
> On Monday 06 February 2006 01:10, tnguyen@symcor.com wrote:
> > Davide,
> >
> > <xsd:complexType name="itemType">
> >    <xsd:sequence>
> >        <xsd:element name="productCode" type="xsd:string" />
>

If you decide to use wscompile, I recommend You to set the searchschema flag:
wscompile -gen:server -d <class destination dir> -f:wsi,strict,searchschema
                 -keep -mapping <path to generated mapping file>
                 <configFile>

The searchschema flag says to wscompile to search schema "aggressively".

where configFile is a file like this:
<?xml version="1.0" encoding="UTF-8"?>

<configuration
    xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
    <wsdl location="META-INF/wsdl/orderRegistrationService.wsdl"
                   packageName="orderRegistrationService"/>
</configuration>

I hope this help You.

-- 
Davide Ling
Sito Personale - http://davideling.altervista.org
Key fingerprint = 284A 0FB9 F9F6 763C D429  E02B AA5D 483A 7E45 D2A6

Re: get back the response message

Posted by Davide Ling <li...@libero.it>.
On Monday 06 February 2006 01:10, tnguyen@symcor.com wrote:
> Davide,
>
> <xsd:complexType name="itemType">
>    <xsd:sequence>
>        <xsd:element name="productCode" type="xsd:string" />
[...]
> In the java bean, how do you define the itemList in this
> orderRegistrationMessageType?
> are you using array or the List type?
> private List itemList; or private Item[] itemList;????

Ah! I usually use wscompile to generate all artifacts from WSDL documents.
In that example I obtained the classes below for ItemListType and ItemType.

I've never used Axis (sorry), only JBoss and  Sun SJSAS .

public class ItemListType {
    protected orderRegistrationService.ItemType[] item;
    
    public ItemListType() {
    }
    
    public ItemListType(orderRegistrationService.ItemType[] item) {
        this.item = item;
    }
    
    public orderRegistrationService.ItemType[] getItem() {
        return item;
    }
    
    public void setItem(orderRegistrationService.ItemType[] item) {
        this.item = item;
    }
}

public class ItemType {
    protected java.lang.String productCode;
    protected java.lang.String productName;
    protected java.math.BigInteger quantity;
    protected double rowPrice;
    
    public ItemType() {
    }
    
    public ItemType(java.lang.String productCode, java.lang.String 
productName, java.math.BigInteger quantity, double rowPrice) {
        this.productCode = productCode;
        this.productName = productName;
        this.quantity = quantity;
        this.rowPrice = rowPrice;
    }
    
    public java.lang.String getProductCode() {
        return productCode;
    }
    
    public void setProductCode(java.lang.String productCode) {
        this.productCode = productCode;
    }
    
    public java.lang.String getProductName() {
        return productName;
    }
    
    public void setProductName(java.lang.String productName) {
        this.productName = productName;
    }
    
    public java.math.BigInteger getQuantity() {
        return quantity;
    }
    
    public void setQuantity(java.math.BigInteger quantity) {
        this.quantity = quantity;
    }
    
    public double getRowPrice() {
        return rowPrice;
    }
    
    public void setRowPrice(double rowPrice) {
        this.rowPrice = rowPrice;
    }
}

I suggest you to use WSDL-to-Java tools (as wscompile) to generate
all support classes from
WSDL documents (or WSDL documents from SEI).

I know axis has a tool like wscompile, but I've never used it.

Bye
-- 
Davide Ling
Sito Personale - http://davideling.altervista.org
Key fingerprint = 284A 0FB9 F9F6 763C D429  E02B AA5D 483A 7E45 D2A6

Re: get back the response message

Posted by tn...@symcor.com.
Davide,

<xsd:complexType name="itemType">
   <xsd:sequence>
       <xsd:element name="productCode" type="xsd:string" />
       <xsd:element default="not specified"
                           name="productName" type="xsd:string" />
       <xsd:element default="1" name="quantity"
                             type="xsd:integer" />
       <xsd:element name="rowPrice" type="xsd:double" />
   </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="itemListType">
        <xsd:sequence>
               <xsd:element maxOccurs="unbounded" minOccurs="1"
                              name="item" type="tns:itemType" />
        </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="orderRegistrationMessageType">
                         <xsd:sequence>
                                                 <xsd:element name="name"
type="xsd:string" />
                                                 <xsd:element
name="surname" type="xsd:string" />
                                                 <xsd:element
name="address" type="tns:addressType" />
                                                 <xsd:element
name="itemList"

type="tns:itemListType" />
                                                 <xsd:element
name="shipMode" type="xsd:string" />
                                                 <xsd:element
name="taxNumber" type="xsd:string" />
                                                 <xsd:element
name="emailAddress" type="xsd:string" />
                         </xsd:sequence>
</xsd:complexType>

In the java bean, how do you define the itemList in this
orderRegistrationMessageType?
are you using array or the List type?
private List itemList; or private Item[] itemList;????

Thanks
Tu




                                                                           
             Davide Ling                                                   
             <lingda@libero.it                                             
             >                                                          To 
                                       agila-user@incubator.apache.org     
             02/05/2006 05:05                                           cc 
             AM                                                            
                                                                   Subject 
                                       Re: get back the response message   
             Please respond to                                             
             agila-user@incuba                                             
              tor.apache.org                                               
                                                                           
                                                                           
                                                                           




On Saturday 04 February 2006 21:14, tnguyen@symcor.com wrote:
> Davide, thanks for the response.  Could you (or anyone) send me a sample
of
> how to construct a soap request and send it to AgilaEngine?

I'm sorry if the example below is quite long,
but the key step are the SOAP headers.

You need three headers: 'partner', 'port' and 'operation', all with
namespace
'http://www.apache.org/agila'.

Another (maybe) interesting thing is how to build up the order item list.
Item list is an ItemType collection in the WSDL document:
<xsd:complexType name="itemType">
   <xsd:sequence>
       <xsd:element name="productCode" type="xsd:string" />
       <xsd:element default="not specified"
                           name="productName" type="xsd:string" />
       <xsd:element default="1" name="quantity"
                             type="xsd:integer" />
       <xsd:element name="rowPrice" type="xsd:double" />
   </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="itemListType">
        <xsd:sequence>
               <xsd:element maxOccurs="unbounded" minOccurs="1"
                              name="item" type="tns:itemType" />
        </xsd:sequence>
</xsd:complexType>

To send the SOAP message see sendSOAPMessage method in the
SOAPMessageHandler
class (the 2nd code section).

Ah... this example would not be a good code example... and
would not be good english example too. I'm sorry.

// ---- The order message builder method
public SOAPMessage createSOAPMessage() throws SOAPException {
        MessageFactory messageFactory = MessageFactory.newInstance();
        SOAPMessage message = messageFactory.createMessage();

        SOAPFactory soapFactory = SOAPFactory.newInstance();

        SOAPMessageHandler soapMessageHandler = new SOAPMessageHandler();

        // ----------- Headers creation -------------
        SOAPHeader header = message.getSOAPHeader();

        soapMessageHandler.createHeaderElement(message, "partner", "tws",
                   "http://www.apache.org/agila","orderingPL");
        soapMessageHandler.createHeaderElement(message, "port", "tws",
                   "http://www.apache.org/agila","orderPT");
        soapMessageHandler.createHeaderElement(message, "operation", "tws",
                   "http://www.apache.org/agila","sendOrder");
        // ---------------------------------------------------

        SOAPBody body = message.getSOAPBody();

        SOAPElement orderMessageElement =
             soapMessageHandler.createIntermediateNode(body ,
"orderMessage",
                     "tn","http://davideling.altervista.org/divisione-wsdl/
");

        soapMessageHandler.createTextSOAPElement(orderMessageElement,
"name",
                     orderMessage.getName());
        soapMessageHandler.createTextSOAPElement(orderMessageElement,
                   "surname", orderMessage.getSurname());

        SOAPElement address = soapMessageHandler.createIntermediateNode(
                    orderMessageElement, "address");

        soapMessageHandler.createTextSOAPElement(address, "street",
                               orderMessage.getAddress().getStreet());
        soapMessageHandler.createTextSOAPElement(address, "number",
                               orderMessage.getAddress().getNumber());
        soapMessageHandler.createTextSOAPElement(address, "city",
                               orderMessage.getAddress().getCity());
        soapMessageHandler.createTextSOAPElement(address, "zip",
                               orderMessage.getAddress().getZip());
        soapMessageHandler.createTextSOAPElement(address, "country",
                               orderMessage.getAddress().getCountry());

        soapMessageHandler.createTextSOAPElement(
              orderMessageElement, "taxNumber",
orderMessage.getTaxNumber());
        soapMessageHandler.createTextSOAPElement(orderMessageElement,
              "cardNumber", orderMessage.getCardNumber());

        SOAPElement itemList = soapMessageHandler.createIntermediateNode(
                                            orderMessageElement,
"itemList");

        Iterator<Item> iterator = orderMessage.getItemList().iterator();
        Item item;
        SOAPElement itemSOAPElement;
        while (iterator.hasNext()) {
            item = iterator.next();
            itemSOAPElement = soapMessageHandler.createIntermediateNode(
                                       itemList, "item");
            soapMessageHandler.createTextSOAPElement(
                      itemSOAPElement, "productCode",
item.getProductCode());
            soapMessageHandler.createIntSOAPElement(
                      itemSOAPElement, "quantity", item.getQuantity());
        }

        soapMessageHandler.createTextSOAPElement(
                orderMessageElement, "shipMode",
orderMessage.getShipMode());
        soapMessageHandler.createDoubleSOAPElement(
              orderMessageElement,
"totalPrice",orderMessage.getTotalPrice());
        soapMessageHandler.createTextSOAPElement(orderMessageElement,
                     "emailAddress", orderMessage.getEmailAddress());

        message.saveChanges();

        return message;
    }

// --------- The Helper class
public class SOAPMessageHandler {
    private SOAPFactory soapFactory;

    /** Creates a new instance of SOAPMessageBuilder */
    public SOAPMessageHandler() throws SOAPException {
        soapFactory = SOAPFactory.newInstance();
    }

    public void createHeaderElement(SOAPMessage message, String
headerElementName, String prefix, String namespace, String
headerElementText)
        throws SOAPException {
        SOAPHeader header = message.getSOAPHeader();
        SOAPHeaderElement operationElement =
header.addHeaderElement(soapFactory.createName(headerElementName,prefix,namespace));

        operationElement.addTextNode(headerElementText);
    }

    public SOAPElement createIntermediateNode(final SOAPElement father,
String
elementName, String prefix, String namespace)
        throws SOAPException {
        Name nodeName = soapFactory.createName(elementName, prefix,
namespace);
        return father.addChildElement(nodeName);
    }

    public SOAPElement createIntermediateNode(final SOAPElement father,
String
elementName)
        throws SOAPException {
        Name nodeName = soapFactory.createName(elementName);
        return father.addChildElement(nodeName);
    }

    public void createTextSOAPElement(final SOAPElement father, String
newElemntName, String newElementText)
        throws SOAPException {

        Name partName = soapFactory.createName(newElemntName);
        SOAPElement newElement = father.addChildElement(partName);
        newElement.addTextNode(newElementText);
    }

    public void createTextSOAPElement(final SOAPElement father, String
newElemntName, String newElementText, String prefix, String namespace)
        throws SOAPException {

        Name partName = soapFactory.createName(newElemntName, prefix,
namespace);
        SOAPElement newElement = father.addChildElement(partName);
        newElement.addTextNode(newElementText);
    }

    public void createIntSOAPElement(final SOAPElement father, String
newElemntName, int newElementValue)
        throws SOAPException {

        Name partName = soapFactory.createName(newElemntName);
        SOAPElement newElement = father.addChildElement(partName);
        newElement.addTextNode(""+newElementValue);
    }

    public void createDoubleSOAPElement(final SOAPElement father, String
newElemntName, double newElementValue)
        throws SOAPException {

        Name partName = soapFactory.createName(newElemntName);
        SOAPElement newElement = father.addChildElement(partName);
        newElement.addTextNode(""+newElementValue);
    }

    public static SOAPMessage sendSOAPMessage(SOAPMessage message, URL
serviceUrl) throws SOAPException {
        SOAPConnectionFactory connectionFactory =
SOAPConnectionFactory.newInstance();
        SOAPConnection connection = connectionFactory.createConnection();
        SOAPMessage response = connection.call(message,  serviceUrl);
        connection.close();
        return response;
    }

I hope these things can help you
Bye

--
Davide Ling
Sito Personale - http://davideling.altervista.org
Key fingerprint = 284A 0FB9 F9F6 763C D429  E02B AA5D 483A 7E45 D2A6



Re: get back the response message

Posted by Davide Ling <li...@libero.it>.
On Saturday 04 February 2006 21:14, tnguyen@symcor.com wrote:
> Davide, thanks for the response.  Could you (or anyone) send me a sample of
> how to construct a soap request and send it to AgilaEngine?

I'm sorry if the example below is quite long,
but the key step are the SOAP headers.

You need three headers: 'partner', 'port' and 'operation', all with namespace
'http://www.apache.org/agila'.

Another (maybe) interesting thing is how to build up the order item list.
Item list is an ItemType collection in the WSDL document:
<xsd:complexType name="itemType">
   <xsd:sequence>
       <xsd:element name="productCode" type="xsd:string" />
       <xsd:element default="not specified"
                           name="productName" type="xsd:string" />
       <xsd:element default="1" name="quantity"
                             type="xsd:integer" />
       <xsd:element name="rowPrice" type="xsd:double" />
   </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="itemListType">
        <xsd:sequence>
               <xsd:element maxOccurs="unbounded" minOccurs="1"
                              name="item" type="tns:itemType" />
        </xsd:sequence>
</xsd:complexType>

To send the SOAP message see sendSOAPMessage method in the SOAPMessageHandler
class (the 2nd code section).

Ah... this example would not be a good code example... and
would not be good english example too. I'm sorry.

// ---- The order message builder method
public SOAPMessage createSOAPMessage() throws SOAPException {
        MessageFactory messageFactory = MessageFactory.newInstance();
        SOAPMessage message = messageFactory.createMessage();
        
        SOAPFactory soapFactory = SOAPFactory.newInstance();
        
        SOAPMessageHandler soapMessageHandler = new SOAPMessageHandler();
        
        // ----------- Headers creation -------------
        SOAPHeader header = message.getSOAPHeader();
               
        soapMessageHandler.createHeaderElement(message, "partner", "tws",
                   "http://www.apache.org/agila","orderingPL");
        soapMessageHandler.createHeaderElement(message, "port", "tws",
                   "http://www.apache.org/agila","orderPT");
        soapMessageHandler.createHeaderElement(message, "operation", "tws",
                   "http://www.apache.org/agila","sendOrder");
        // ---------------------------------------------------        

        SOAPBody body = message.getSOAPBody();
        
        SOAPElement orderMessageElement =
             soapMessageHandler.createIntermediateNode(body , "orderMessage",
                     "tn","http://davideling.altervista.org/divisione-wsdl/");
        
        soapMessageHandler.createTextSOAPElement(orderMessageElement, "name",
                     orderMessage.getName());
        soapMessageHandler.createTextSOAPElement(orderMessageElement,
                   "surname", orderMessage.getSurname());
        
        SOAPElement address = soapMessageHandler.createIntermediateNode(
                    orderMessageElement, "address");
        
        soapMessageHandler.createTextSOAPElement(address, "street", 
                               orderMessage.getAddress().getStreet());
        soapMessageHandler.createTextSOAPElement(address, "number",
                               orderMessage.getAddress().getNumber());
        soapMessageHandler.createTextSOAPElement(address, "city",
                               orderMessage.getAddress().getCity());
        soapMessageHandler.createTextSOAPElement(address, "zip",
                               orderMessage.getAddress().getZip());
        soapMessageHandler.createTextSOAPElement(address, "country",
                               orderMessage.getAddress().getCountry());
        
        soapMessageHandler.createTextSOAPElement(
              orderMessageElement, "taxNumber", orderMessage.getTaxNumber());
        soapMessageHandler.createTextSOAPElement(orderMessageElement,
              "cardNumber", orderMessage.getCardNumber());
        
        SOAPElement itemList = soapMessageHandler.createIntermediateNode(
                                            orderMessageElement,  "itemList");
        
        Iterator<Item> iterator = orderMessage.getItemList().iterator();
        Item item;
        SOAPElement itemSOAPElement;
        while (iterator.hasNext()) {
            item = iterator.next();
            itemSOAPElement = soapMessageHandler.createIntermediateNode(
                                       itemList, "item");
            soapMessageHandler.createTextSOAPElement(
                      itemSOAPElement, "productCode", item.getProductCode());
            soapMessageHandler.createIntSOAPElement(
                      itemSOAPElement, "quantity", item.getQuantity());
        }
        
        soapMessageHandler.createTextSOAPElement(
                orderMessageElement, "shipMode", orderMessage.getShipMode());
        soapMessageHandler.createDoubleSOAPElement(
              orderMessageElement, "totalPrice",orderMessage.getTotalPrice());
        soapMessageHandler.createTextSOAPElement(orderMessageElement,
                     "emailAddress", orderMessage.getEmailAddress());
        
        message.saveChanges();
        
        return message;   
    }

// --------- The Helper class
public class SOAPMessageHandler {
    private SOAPFactory soapFactory;
    
    /** Creates a new instance of SOAPMessageBuilder */
    public SOAPMessageHandler() throws SOAPException {
        soapFactory = SOAPFactory.newInstance();
    }
    
    public void createHeaderElement(SOAPMessage message, String 
headerElementName, String prefix, String namespace, String headerElementText)
        throws SOAPException {
        SOAPHeader header = message.getSOAPHeader();
        SOAPHeaderElement operationElement = 
header.addHeaderElement(soapFactory.createName(headerElementName,prefix,namespace));
        operationElement.addTextNode(headerElementText);
    }
    
    public SOAPElement createIntermediateNode(final SOAPElement father, String 
elementName, String prefix, String namespace)
        throws SOAPException {
        Name nodeName = soapFactory.createName(elementName, prefix, 
namespace);
        return father.addChildElement(nodeName);
    }
    
    public SOAPElement createIntermediateNode(final SOAPElement father, String 
elementName)
        throws SOAPException {
        Name nodeName = soapFactory.createName(elementName);
        return father.addChildElement(nodeName);
    }
    
    public void createTextSOAPElement(final SOAPElement father, String 
newElemntName, String newElementText)
        throws SOAPException {

        Name partName = soapFactory.createName(newElemntName);
        SOAPElement newElement = father.addChildElement(partName);
        newElement.addTextNode(newElementText);
    }
    
    public void createTextSOAPElement(final SOAPElement father, String 
newElemntName, String newElementText, String prefix, String namespace)
        throws SOAPException {

        Name partName = soapFactory.createName(newElemntName, prefix, 
namespace);
        SOAPElement newElement = father.addChildElement(partName);
        newElement.addTextNode(newElementText);
    }
    
    public void createIntSOAPElement(final SOAPElement father, String 
newElemntName, int newElementValue)
        throws SOAPException {

        Name partName = soapFactory.createName(newElemntName);
        SOAPElement newElement = father.addChildElement(partName);
        newElement.addTextNode(""+newElementValue);
    }
    
    public void createDoubleSOAPElement(final SOAPElement father, String 
newElemntName, double newElementValue)
        throws SOAPException {

        Name partName = soapFactory.createName(newElemntName);
        SOAPElement newElement = father.addChildElement(partName);
        newElement.addTextNode(""+newElementValue);
    }
    
    public static SOAPMessage sendSOAPMessage(SOAPMessage message, URL 
serviceUrl) throws SOAPException {
        SOAPConnectionFactory connectionFactory = 
SOAPConnectionFactory.newInstance();
        SOAPConnection connection = connectionFactory.createConnection();
        SOAPMessage response = connection.call(message,  serviceUrl);
        connection.close();
        return response;
    }

I hope these things can help you
Bye

-- 
Davide Ling
Sito Personale - http://davideling.altervista.org
Key fingerprint = 284A 0FB9 F9F6 763C D429  E02B AA5D 483A 7E45 D2A6

Re: get back the response message

Posted by tn...@symcor.com.
Davide, thanks for the response.  Could you (or anyone) send me a sample of
how to construct a soap request and send it to AgilaEngine?

Thanks a lot.
Tu


                                                                           
             Davide Ling                                                   
             <lingda@libero.it                                             
             >                                                          To 
                                       agila-user@incubator.apache.org     
             01/31/2006 03:16                                           cc 
             PM                                                            
                                                                   Subject 
                                       Re: get back the response message   
             Please respond to                                             
             agila-user@incuba                                             
              tor.apache.org                                               
                                                                           
                                                                           
                                                                           




On Tuesday 31 January 2006 20:17, tnguyen@symcor.com wrote:
> How do I can get the response message back?
> In the bpel file, I have input, then I assign this input variable to
> realInput variable and I use 2 ways invoke this realInput variable as
> inputVariable and output variable as outputVariable.
> in the client: I use for example:
> org.w3c.dom.Document returnDoc = engineClient.acknowledge(
> "converterLink", "Converter", "celsiusToFarenheit", new
> DOMWriter().write(doc));

I don't know if this can help You,
below I use the SAAJ API.
I get a SOAPMessage response.
and SOAPPart implements org.w3c.dom.Document interface

public void testSendMessage() throws Exception {

 URL serviceURL = new
URL("http://daltanius:8080/agila-ws/services/AgilaEngine");

 SOAPMessage response =
SOAPMessageHandler.sendSOAPMessage(orderSOAPMessage,
serviceURL);

 SOAPUtilityMethods.printSoapMessage(response);

 XPath xpath = createXpathQuery("//message/return-code/text()");

Iterator returnCodes = ((ArrayList)
xpath.evaluate(response.getSOAPPart())).iterator();

assertEquals("testSendMessage","0",
((TextImpl)returnCodes.next()).getData());
}


Bye
--
Davide Ling
Sito Personale - http://davideling.altervista.org
Key fingerprint = 284A 0FB9 F9F6 763C D429  E02B AA5D 483A 7E45 D2A6



Re: get back the response message

Posted by Davide Ling <li...@libero.it>.
On Tuesday 31 January 2006 20:17, tnguyen@symcor.com wrote:
> How do I can get the response message back?
> In the bpel file, I have input, then I assign this input variable to
> realInput variable and I use 2 ways invoke this realInput variable as
> inputVariable and output variable as outputVariable.
> in the client: I use for example:
> org.w3c.dom.Document returnDoc = engineClient.acknowledge(
> "converterLink", "Converter", "celsiusToFarenheit", new
> DOMWriter().write(doc));

I don't know if this can help You,
below I use the SAAJ API.
I get a SOAPMessage response.
and SOAPPart implements org.w3c.dom.Document interface

public void testSendMessage() throws Exception {

 URL serviceURL = new 
URL("http://daltanius:8080/agila-ws/services/AgilaEngine");
 
 SOAPMessage response = SOAPMessageHandler.sendSOAPMessage(orderSOAPMessage, 
serviceURL); 
          
 SOAPUtilityMethods.printSoapMessage(response); 
         
 XPath xpath = createXpathQuery("//message/return-code/text()"); 
 
Iterator returnCodes = ((ArrayList)  
xpath.evaluate(response.getSOAPPart())).iterator(); 
        
assertEquals("testSendMessage","0", ((TextImpl)returnCodes.next()).getData());        
}


Bye
-- 
Davide Ling
Sito Personale - http://davideling.altervista.org
Key fingerprint = 284A 0FB9 F9F6 763C D429  E02B AA5D 483A 7E45 D2A6