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 Index » WebSphere Message Broker (ACE) Support » Error passing parameters to webservices' method, SOAP nodes

Post new topic  Reply to topic
 Error passing parameters to webservices' method, SOAP nodes « View previous topic :: View next topic » 
Author Message
gilberthg
PostPosted: Thu May 03, 2012 9:04 am    Post subject: Error passing parameters to webservices' method, SOAP nodes Reply with quote

Novice

Joined: 01 Feb 2012
Posts: 14
Location: Costa Rica

Hi Gurus

I have a problem passing parameters to webservices' method, using SOAP nodes , any idea?

The situation is this:

1- WMBroker 8 . I created an aplication starting with a WSDL

The wsdl is from a site that offers webservices to do client testing for example. The service I'll use is for getting whois information about websites.

The WSDL is :

<?xml version="1.0" encoding="utf-8"?>
<definitions name="whois" targetNamespace="http://www.webservicex.net" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:http="http://www.w3.org/TR/html4/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.webservicex.net" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<documentation>
<appinfo source="WMQI_APPINFO">
<MRWSDLAppInfo imported="true">
<binding hasEncoding="false" imported="true" name="whoisSoap" originalBindingStyle="document"/>
</MRWSDLAppInfo>
</appinfo>
</documentation>

<types>
<s:schema>
<s:import namespace="http://www.webservicex.net" schemaLocation="RemoteFiles/net/webservicex/www/whois.xsd"/>
</s:schema>
</types>
<message name="GetWhoISSoapIn">
<part element="tns:GetWhoIS" name="parameters"/>
</message>
<message name="GetWhoISSoapOut">
<part element="tns:GetWhoISResponse" name="parameters"/>
</message>



<portType name="whoisSoap">
<operation name="GetWhoIS">
<input message="tns:GetWhoISSoapIn"/>
<output message="tns:GetWhoISSoapOut"/>
</operation>
</portType>


<binding name="whoisSoap" type="tns:whoisSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="GetWhoIS">
<soap:operation soapAction="http://www.webservicex.net/GetWhoIS" style="document"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>


<service name="whois">
<port binding="tns:whoisSoap" name="whoisSoap">
<soap:address location="http://www.webservicex.net/whois.asmx"/>
</port>

</service>


</definitions>


1.5 - The additional XSD is :

<?xml version="1.0" encoding="UTF-8"?>

<s:schema elementFormDefault="qualified" targetNamespace="http://www.webservicex.net" version="1.0" xmlns:tns="http://www.webservicex.net" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:ibmSchExtn="http://www.ibm.com/schema/extensions" >

<s:element name="GetWhoIS">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="HostName" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetWhoISResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetWhoISResult" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="string" nillable="true" type="s:string"/>

</s:schema>



2- After I created an MQ Input NODE, the output of this is going to a compute node, previous to the subflow just generated in 1.

So we have, an MQ Input node, a Compute Node , and then the subflow generated from the WSDL.

3- The example message I'm sending to the MQ Queque is ( very simple ):

<?xml version="1.0" encoding="utf-8"?>
<whois>
<localElement>
<HostName>
www.google.com
</HostName>
</localElement>
</whois>

4- The Compute node logic is ( again, very simple ):

DECLARE ns NAMESPACE 'http://www.webservicex.net/';

CREATE COMPUTE MODULE MyFlow_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN

SET OutputRoot.XMLNSC.ns:GetWhoIs.HostName = InputRoot.XMLNSC.whois.localElement.HostName;


RETURN TRUE;
END;


END MODULE;

4- The error I'm getting is :


HTTP/1.1 500 Internal Server Error
Cache-Control: private
Content-Length: 576
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Thu, 03 May 2012 16:28:45 GMT

<SOAP_Domain_Msg xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><Context operation="GetWhoIS" operationType="UNKNOWN" portType="whoisSoap" portTypeNamespace="http://www.webservicex.net" port="whoisSoap" service="whois" fileName="whois.wsdl"><SOAP_Version>1.1</SOAP_Version><Namespace xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/><_XmlDeclaration Version="1.0" Encoding="utf-8"/></Context><Header/><Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>System.Web.Services.Protocols.SoapException: Server was unable to process request. ---&gt; System.ArgumentNullException: Value cannot be null.
at whois.whois.GetWhoIS(String HostName)
--- End of inner exception stack trace ---</faultstring><detail/></soap:Fault></Body></SOAP_Domain_Msg>



5- Please give me any advice, because I don't know where to search for the problem.

I developed another similar webservice, for a simple calculator java webservice, in glassfish local to my box, and it worked smooth ....

I look for the 2 wsdl and they are very similar in structure ...


thanks!


Gilberth
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Thu May 03, 2012 9:08 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

If you read the fault message, you'll see that it's telling you you aren't sending the right thing in the Hostname field of the soaprequest.
Back to top
View user's profile Send private message
gilberthg
PostPosted: Thu May 03, 2012 9:17 am    Post subject: That's the problem, the subflow generated must do it,or not? Reply with quote

Novice

Joined: 01 Feb 2012
Posts: 14
Location: Costa Rica

Thanks, correct

But that's the problem, the subflow generated using the WSDL has to construct the webservice's invoking, using the

"OutputRoot.XMLNSC.ns:GetWhoIs.HostName "

I'm providing it , at the Compute node , or not ?

This is the only point where I work with the parameters.


Thanks again...
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Thu May 03, 2012 9:38 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

It's not a question of what the compute node does or doesn't do, exactly.

It's a question of what the logical message tree before the soap request node looks like.

Take a user trace. put in a trace node.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Thu May 03, 2012 9:45 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Put in [c o d e ] tags also. You should have Trace nodes before and after every major node in your flow.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mgk
PostPosted: Thu May 03, 2012 9:56 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Have you checked that the MQInput node is set to use the XMLNSC parser?

If you have, then I agree with mqjeff that you should put a trace node after the compute node before the SOAPRequest node and trace $Root.

Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
gilberthg
PostPosted: Thu May 03, 2012 12:15 pm    Post subject: Thanks all : Trace result Reply with quote

Novice

Joined: 01 Feb 2012
Posts: 14
Location: Costa Rica

Tranks all

I already checked XMLNSC parser mgk suggests.

1- The trace result is not what I expected, it seems like there is no "body" in the message flow that is entering the soap subflow :

The trace contents are only :

<NS1:GetWhoIs xmlns:NS1="http://www.webservicex.net/"/>

2- I put a message in the queue, that I posted before :

<?xml version="1.0" encoding="utf-8"?>
<whois><localElement>
<HostName>www.google.com</HostName>
</localElement></whois>

3- And the code of the Compute node is :

DECLARE ns NAMESPACE 'http://www.webservicex.net/';

CREATE COMPUTE MODULE MyFlow_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN

SET OutputRoot.XMLNSC.ns:GetWhoIs.HostName = InputRoot.XMLNSC.whois.localElement.HostName;


RETURN TRUE;
END;


END MODULE;


This is a diagram of the message flow ...



[img] http://www.dactiv.com/foro/images/flow.jpg[/img]
Back to top
View user's profile Send private message Send e-mail
lancelotlinc
PostPosted: Thu May 03, 2012 12:16 pm    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

SET OutputRoot.SOAP.Body.ns:xyz = zyx.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
gilberthg
PostPosted: Thu May 03, 2012 2:32 pm    Post subject: SOAPRequest NODE receives message ok, but fails Reply with quote

Novice

Joined: 01 Feb 2012
Posts: 14
Location: Costa Rica

Thanks again

1- Using trace getting to subflow, the IN node traces to :

<NS1:GetWhoIs xmlns:NS1="http://www.webservicex.net/">
<HostName>www.google.com</HostName></NS1:GetWhoIs>

That looks ok to me , but :

2- the SOAPRequest node fails with the error descirbed, but the SOAPRequest is configurated automaticly from the wsld , and the wsdl ( I posted before ) I think is ok to , so I don't know why it fails ... :

<SOAP_Domain_Msg xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><Context operation="GetWhoIS" operationType="UNKNOWN" portType="whoisSoap" portTypeNamespace="http://www.webservicex.net" port="whoisSoap" service="whois" fileName="whois.wsdl"><SOAP_Version>1.1</SOAP_Version><Namespace xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/><_XmlDeclaration Version="1.0" Encoding="utf-8"/></Context><Header/><Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>System.Web.Services.Protocols.SoapException: Server was unable to process request. ---&gt; System.ArgumentNullException: Value cannot be null.
at whois.whois.GetWhoIS(String HostName)
--- End of inner exception stack trace ---</faultstring><detail/></soap:Fault></Body></SOAP_Domain_Msg>


thanks
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Error passing parameters to webservices' method, SOAP nodes
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.