ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere Message Broker (ACE) SupportProblem with web service

Post new topicReply to topic
Problem with web service View previous topic :: View next topic
Author Message
ejgil_1
PostPosted: Thu Jul 06, 2006 10:54 pm Post subject: Problem with web service Reply with quote

Newbie

Joined: 12 Jun 2006
Posts: 9
Location: Valencia, Spain

Hi
I need to develop a web service with Message broker (toolkit v.5.0.7) and I have developed a message flow with:

HttpInput->Compute->HttpReply

The compute code is:
Code:
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
   SET OutputRoot = InputRoot;
   SET OutputRoot.MRM.*:Body.*:http.HTTPInputBody.OutputData.Data = 'xxxNEWDATAxxx';
RETURN TRUE;
END;


I have created a message definition file importing this xsd file:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.mrmnames.net"
    xmlns:mrm="http://www.mrmnames.net"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:complexType name="HTTPMessageType">
        <xsd:sequence>
            <xsd:element name="URL" type="xsd:string"/>
            <xsd:element name="InputData" type="mrm:DataType"/>
            <xsd:element name="OutputData" type="mrm:DataType"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="DataType">
        <xsd:sequence>
            <xsd:element name="Data" type="xsd:string"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="HTTPInput" type="mrm:HTTPMessageType"/>
    <xsd:element name="HTTPOutput" type="mrm:HTTPMessageType"/>
</xsd:schema>


I use NetTool (v 4.5.1) to put this SOAP message:

Code:
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
    <ns1:http xmlns:ns1="tns:HTTPMsgSetPortType" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <HTTPInputBody xmlns:ns2="http://www.mrmnames.net" xsi:type="ns2:HTTPMessageType">
   <URL xsi:type="xsd:string">Test_url_ejemplo01</URL>
   <InputData xsi:type="ns2:DataType">
      <Data xsi:type="xsd:string">TEST_input_ejemplo01</Data>
   </InputData>
   <OutputData xsi:type="ns2:DataType">
      <Data xsi:type="xsd:string">TEST_input_ejemplo01</Data>
   </OutputData>
    </HTTPInputBody>
    </ns1:http>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


And then I invoke the web service so that it returns this soap message:

Code:
<?xml version="1.0"?>
<tns:Envelope xmlns:tns="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns2="http://www.mrmnames.net"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tns:Body>
<NS1:http xmlns:NS1="tns:HTTPMsgSetPortType" tns:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<HTTPInputBody xsi:type="ns2:HTTPMessageType">
<URL xsi:type="xsd:string">Test_url_ejemplo01</URL>
<InputData xsi:type="ns2:DataType">
<Data xsi:type="xsd:string">TEST_input_ejemplo01</Data>
</InputData>
<OutputData xsi:type="ns2:DataType">
<Data xsi:type="xsd:string">xxxNEWDATAxxx</Data>
</OutputData>
</HTTPInputBody>
</NS1:http>
</tns:Body>
</tns:Envelope>


In this response soap message the field OutputData.Data has the new value 'xxxNEWDATAxxx'

But the problem that I have is that I don´t know what happens

When I test this web service with a client application it retuns nothing.
I generate the wsdl files and then wsdl2java (with AXIS) to generate a java client applicacion. My test class is:

Code:
public static void main(String[] args) {
try {
   Ej_01HTTP_SOAP_Service service = new Ej_01HTTP_SOAP_ServiceLocator();
   Ej_01PortType port = service.getHTTPSOAPPort();
   
   HTTPMessageType msgIn = new HTTPMessageType();
   DataType data_in = new DataType();
   data_in.setData("TEST_Input_ejemplo01");
   msgIn.setURL("Test_url_ejemplo01");
   msgIn.setInputData(data_in);         
         
   HTTPMessageType msgOut = new HTTPMessageType();   
   DataType data_out = new DataType();
   data_out.setData("TEST_Output_ejemplo01");                   
   msgIn.setOutputData(data_out);   
              
   msgOut = port.message_Category(msgIn);
         
   System.out.println("DATA is :" + msgOut.getOutputData().getData());
} catch (Exception ex){
 ex.printStackTrace();
}
}


And the result is the same that I put in the InputData.:

“DATA is :TEST_Output_ejemplo01”

Can anyone help me? Why do I get the input data? is there any problem with the response soap message?
I extract this sample from:
http://www-128.ibm.com/developerworks/websphere/library/techarticles/0311_withers/withers.html
Sample 3 Scenario 2 and Websphere Integrator.

Thanks.

Emilio.
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker (ACE) SupportProblem with web service
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.