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 » Calling an external webservice--problem with the request msg

Post new topic  Reply to topic Goto page 1, 2, 3  Next
 Calling an external webservice--problem with the request msg « View previous topic :: View next topic » 
Author Message
chris boehnke
PostPosted: Thu Sep 20, 2007 5:07 am    Post subject: Calling an external webservice--problem with the request msg Reply with quote

Partisan

Joined: 25 Jul 2006
Posts: 369

Hi guys,
I am calling an external webservice by using httpRequest node in my message flow.

The message we're receiving, has all of the XML escaped (i.e. the '<' is turned into '&lt;' and '>' is turned into '&gt;') and thus is nothing more than plain text. The only time I've been able to get it to work is when I place a <![CDATA[...]]> tag around the request message. That in the simplest terms causes all the xml tags in the SOAP body to be escaped. Can you guys share with me how to handle these special characters in broker.

Thanks.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Sep 20, 2007 5:26 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Which message has all of the XML characters escaped?

The message you are sending out via the HTTPRequest node? Or the response?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
chris boehnke
PostPosted: Thu Sep 20, 2007 5:49 am    Post subject: Reply with quote

Partisan

Joined: 25 Jul 2006
Posts: 369

jefflowrey wrote:
Which message has all of the XML characters escaped?

The message you are sending out via the HTTPRequest node? Or the response?


Hi Jeff,
We are sending the request message to the external webservice through the HTTPRequest node.

The response message from the Webservice has all of the XML characters escaped.
I've been able to get it to work is when I place a <![CDATA[...]]> tag around the request message. That in the simplest terms causes all the xml tags in the SOAP body to be escaped.

One more thing to share with you is: When I use a HTTP POST method, I am getting the Internal server error - 500
and
when I use the HTTP GET method, I am getting the response from the webservice with some XML parsing errors.

I am wondering which method do we need to use and which is better to use?. Does it depends on the service that we are calling or is there any special way of using POST and GET methods?.

Thanks in advance.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Sep 20, 2007 5:51 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

It sounds like you need to talk to the people who wrote the service that you are invoking.

It doesn't sound like they're handling your request correctly.

And they will be the ones to tell you if you should be using GET or POST - as they're the ones that decide which to support, or if they want to support both equally.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
chris boehnke
PostPosted: Sun Sep 23, 2007 2:33 pm    Post subject: Reply with quote

Partisan

Joined: 25 Jul 2006
Posts: 369

jefflowrey wrote:
It sounds like you need to talk to the people who wrote the service that you are invoking.

It doesn't sound like they're handling your request correctly.

And they will be the ones to tell you if you should be using GET or POST - as they're the ones that decide which to support, or if they want to support both equally.


The external service what I am trying to call is expecting the message in this format:

POST /aws/PassportToGo.asmx HTTP/1.1
Host: aws.demo.air-worldwide.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://air-worldwide.com/webservices/GetISOData"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetISOData xmlns="http://air-worldwide.com/webservices/">
<xmlReqStg>string</xmlReqStg>
</GetISOData>
</soap:Body>
</soap:Envelope>

In the above message, in place of string we are sending some additional data which is required as below.

We have a stylesheet in generating the request message in this format.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xalan="http://xml.apache.org/xslt">
<xsl:import href="../includes/_SOAGlobalVariables.xsl" />
<xsl:import href="../includes/_SOARoutingConfiguration.xsl" />
<xsl:output method="xml" indent="yes"/>
<xsl:template match="INPUT_ISO_REF_NUM">
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Body>
<GetISOData xmlns="http://air-worldwide.com/webservices/">
<xmlReqStg>
<![CDATA[<ISORequests>
<RequestHeader>
<AIR>
<LoginID>abcdefgh_ws</LoginID>
<Password>abcd1234</Password>
<LicenseKey>123456789</LicenseKey>
</AIR>
<HomeValue>
<UserName>abcdefgh_ws</UserName>
<Password>abcd1234</Password>
<LicenseKey>123456789</LicenseKey>
</HomeValue>
</RequestHeader>
<ISORequest>
<Products>GetHomeValueData</Products>
<Addresses>
<Address>
<RequestID>IQ-347593346-070206-103732</RequestID>
</Address>
</Addresses>
</ISORequest>
</ISORequests>]]>
</xmlReqStg>
</GetISOData>
</soap:Body>
</soap:Envelope>
</xsl:template>
</xsl:stylesheet>



If we include the data in place of string in CDATA(stylesheet) we are getting the response from the web service. If we dont include the CDATA in the above stylesheet, I am getting the error as bad request .

Please suggest me what actions can I take to avoid this.

Thanks in advance.
Back to top
View user's profile Send private message
chris boehnke
PostPosted: Sun Sep 23, 2007 3:02 pm    Post subject: Reply with quote

Partisan

Joined: 25 Jul 2006
Posts: 369

Hi Guys,
When I write the response from the webservice to a queue, I dont see the '<' and '>' and in place of them I see '&lt' and '&gt' whereas I see the '<' and '>' when I write the response to a trace file.

Here I am posting the response what I am getting when I write it to a queue:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope 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">
<soap:Body>
<GetISODataResponse xmlns="http://air-worldwide.com/webservices/">
<GetISODataResult>&lt;ISOResponses&gt;&lt;ResponseHeader&gt;&lt;AIRTrack&gt;&lt;Instance&gt;633261700700731123;dhvasf1;AWS;2007-09-23T18:47:50.073-0400;/LM/W3SVC/1/Root/AWS-1-128350610491881421;&lt;/Instance&gt;&lt;Instance&gt;633261700700731123;dhvasf1;8089;2007-09-23T18:47:50.073-0400;Air.VL.ServiceHost.ServiceDriver.exe;AccumResponse;&lt;/Instance&gt;&lt;/AIRTrack&gt;&lt;runtimeinformation responseid="1258357258;633261700700731123" clientparam="UnknownUserHostAddress"&gt;&lt;time start="9/23/2007 6:47:49 PM" end="9/23/2007 6:47:50 PM" timespan="1.000" /&gt;&lt;count reportcount="1" errorcount="0" /&gt;&lt;/runtimeinformation&gt;&lt;/ResponseHeader&gt;&lt;Reports&gt;&lt;Report product="GetHomeValueData" version="5.2.0.24" timespan="1.000" sequence="11773" success="True" ASF.ErrorCode="0" ASF.ErrorMessage="" ASF.InfoMessage="Consolidated HomeValue with Engine" ASF.PercentCompleted="" ASF.StatusMessage="" ASF.Logfile=""&gt;&lt;Responses&gt;&lt;Response&gt;&lt;Report product="GetHomeValueData" xmlns:ns="urn:schemas-microsoft-com:xslt"&gt;&lt;Status&gt;COMPLETE&lt;/Status&gt;&lt;RequestID&gt;IQ-347593346-070206-103732&lt;/RequestID&gt;&lt;LocGUID&gt;{20377DF5-F7B5-DB11-B97A-000423786E34}&lt;/LocGUID&gt;&lt;StdAddress&gt;&lt;StreetAddress&gt;35 TROPHY LN&lt;/StreetAddress&gt;&lt;StreetNumber&gt;35&lt;/StreetNumber&gt;&lt;StreetNumberSuffix /&gt;&lt;StreetPrefix /&gt;&lt;StreetName&gt;TROPHY&lt;/StreetName&gt;&lt;StreetType&gt;LN&lt;/StreetType&gt;&lt;StreetSuffix /&gt;&lt;StreetUnit /&gt;&lt;City&gt;POINCIANA&lt;/City&gt;&lt;State&gt;FL&lt;/State&gt;&lt;ZIP5&gt;34759&lt;/ZIP5&gt;&lt;ZIP4&gt;3346&lt;/ZIP4&gt;&lt;ZIP9 /&gt;&lt;Zip&gt;34759&lt;/Zip&gt;&lt;County&gt;POLK&lt;/County&gt;&lt;/StdAddress&gt;&lt;PropertyInfo&gt;&lt;LocationName source="2"&gt;IQ-347593346-070206-103732&lt;/LocationName&gt;&lt;CreateDateTime source="2"&gt;02/06/2007 - 10:37:32 AM&lt;/CreateDateTime&gt;&lt;LivingSquareFeet est="1600" ppn="" gui="1600" source="2"&gt;1600&lt;/LivingSquareFeet&gt;&lt;YearBuilt est="1933" gui="1933" ppn="1933" source="2"&gt;1933&lt;/YearBuilt&gt;&lt;/PropertyInfo&gt;&lt;RepCostResults date="20070215" time="02/15/2007 - 9:05:16 AM" svc="C1023-L09190-A11637-T11350-C098-G040-S100-X100-P104-R100-U500:100-ms0-F13755-t10569-B10520-EB61204" build="4.6.0.20061204.1000" JobID="1466934"&gt;&lt;coverage id="A" ev="$158,927" lo="$110,151" hi="$229,301"&gt;&lt;est id="A00" name="TOTAL" ev="158,927" sft="99.33" pct="100.0%" /&gt;&lt;est id="A01" name="Site Preparation" ev="3,068" sft="1.92" pct="1.9%" /&gt;&lt;est id="A02" name="Excavation" ev="1,863" sft="1.16" pct="1.2%" /&gt;&lt;est id="A03" name="Foundation" ev="17,518" sft="10.95" pct="11.0%" /&gt;&lt;est id="A05" name="Floor Construction" ev="13,462" sft="8.41" pct="8.5%" /&gt;&lt;est id="A06" name="Ext Wall Const." ev="16,596" sft="10.37" pct="10.4%" /&gt;&lt;est id="A07" name="Ext Windows+Doors" ev="11,947" sft="7.47" pct="7.5%" /&gt;&lt;est id="A08" name="Roof Construction" ev="15,311" sft="9.57" pct="9.6%" /&gt;&lt;est id="A09" name="Inter. Construction" ev="7,838" sft="4.90" pct="4.9%" /&gt;&lt;est id="A10" name="Inter. Finishes" ev="9,619" sft="6.01" pct="6.1%" /&gt;&lt;est id="A11" name="Ceilings" ev="7,483" sft="4.68" pct="4.7%" /&gt;&lt;est id="A12" name="Specialties" ev="0" sft="0.00" pct="0.0%" /&gt;&lt;est id="A13" name="Floor Finish" ev="5,409" sft="3.38" pct="3.4%" /&gt;&lt;est id="A14" name="HVAC" ev="5,430" sft="3.39" pct="3.4%" /&gt;&lt;est id="A15" name="Plumbing" ev="12,433" sft="7.77" pct="7.8%" /&gt;&lt;est id="A16" name="Electrical" ev="3,934" sft="2.46" pct="2.5%" /&gt;&lt;est id="A17" name="OH+Fees+Profit" ev="27,018" sft="16.89" pct="17.0%" /&gt;&lt;est id="A90" name="Special Features" ev="0" sft="0.00" pct="0.0%" /&gt;&lt;/coverage&gt;&lt;coverage id="B" ev="$0" lo="" hi="" /&gt;&lt;/RepCostResults&gt;&lt;/Report&gt;&lt;/Response&gt;&lt;/Responses&gt;&lt;/Report&gt;&lt;/Reports&gt;&lt;/ISOResponses&gt;</GetISODataResult>
</GetISODataResponse>
</soap:Body>
</soap:Envelope>


Here I am posting the response when I write it to a Trace file where we can see '<' and '>'.

'<ISOResponses><ResponseHeader><AIRTrack><Instance>633261722891575327;dhvasf1;AWS;2007-09-23T19:2
4:49.157-0400;/LM/W3SVC/1/Root/AWS-5-128350633465447085;</Instance><Instance>633261722891419072;dhvasf1;8089;2007-09-23T19:24
:49.141-0400;Air.VL.ServiceHost.ServiceDriver.exe;AccumResponse;</Instance></AIRTrack><runtimeinformation responseid="1258357
258;633261722891419072" clientparam="UnknownUserHostAddress"><time start="9/23/2007 7:24:47 PM" end="9/23/2007 7:24:49 PM" ti
mespan="1.172" /><count reportcount="1" errorcount="0" /></runtimeinformation></ResponseHeader><Reports><Report product="GetH
omeValueData" version="5.2.0.24" timespan="1.172" sequence="11781" success="True" ASF.ErrorCode="0" ASF.ErrorMessage="" ASF.I
nfoMessage="Consolidated HomeValue with Engine" ASF.PercentCompleted="" ASF.StatusMessage="" ASF.Logfile=""><Responses><Respo
nse><Report product="GetHomeValueData" xmlns:ns="urn:schemas-microsoft-com:xslt"><Status>COMPLETE</Status><RequestID>IQ-34759
3346-070206-103732</RequestID><LocGUID>{20377DF5-F7B5-DB11-B97A-000423786E34}</LocGUID><StdAddress><StreetAddress>35 TROPHY L
N</StreetAddress><StreetNumber>35</StreetNumber><StreetNumberSuffix /><StreetPrefix /><StreetName>TROPHY</StreetName><StreetT
ype>LN</StreetType><StreetSuffix /><StreetUnit /><City>POINCIANA</City><State>FL</State><ZIP5>34759</ZIP5><ZIP4>3346</ZIP4><Z
IP9 /><Zip>34759</Zip><County>POLK</County></StdAddress><PropertyInfo><LocationName source="2">IQ-347593346-070206-103732</Lo
cationName><CreateDateTime source="2">02/06/2007 - 10:37:32 AM</CreateDateTime><LivingSquareFeet est="1600" ppn="" gui="1600"
source="2">1600</LivingSquareFeet><YearBuilt est="1933" gui="1933" ppn="1933" source="2">1933</YearBuilt></PropertyInfo><Rep
CostResults date="20070215" time="02/15/2007 - 9:05:16 AM" svc="C1023-L09190-A11637-T11350-C098-G040-S100-X100-P104-R100-U500
:100-ms0-F13755-t10569-B10520-EB61204" build="4.6.0.20061204.1000" JobID="1466934"><coverage id="A" ev="$158,927" lo="$110,15
1" hi="$229,301"><est id="A00" name="TOTAL" ev="158,927" sft="99.33" pct="100.0%" /><est id="A01" name="Site Preparation" ev=
"3,068" sft="1.92" pct="1.9%" /><est id="A02" name="Excavation" ev="1,863" sft="1.16" pct="1.2%" /><est id="A03" name="Founda
tion" ev="17,518" sft="10.95" pct="11.0%" /><est id="A05" name="Floor Construction" ev="13,462" sft="8.41" pct="8.5%" /><est
id="A06" name="Ext Wall Const." ev="16,596" sft="10.37" pct="10.4%" /><est id="A07" name="Ext Windows+Doors" ev="11,947" sft=
"7.47" pct="7.5%" /><est id="A08" name="Roof Construction" ev="15,311" sft="9.57" pct="9.6%" /><est id="A09" name="Inter. Con
struction" ev="7,838" sft="4.90" pct="4.9%" /><est id="A10" name="Inter. Finishes" ev="9,619" sft="6.01" pct="6.1%" /><est id
="A11" name="Ceilings" ev="7,483" sft="4.68" pct="4.7%" /><est id="A12" name="Specialties" ev="0" sft="0.00" pct="0.0%" /><es
t id="A13" name="Floor Finish" ev="5,409" sft="3.38" pct="3.4%" /><est id="A14" name="HVAC" ev="5,430" sft="3.39" pct="3.4%"
/><est id="A15" name="Plumbing" ev="12,433" sft="7.77" pct="7.8%" /><est id="A16" name="Electrical" ev="3,934" sft="2.46" pct
="2.5%" /><est id="A17" name="OH+Fees+Profit" ev="27,018" sft="16.89" pct="17.0%" /><est id="A90" name="Special Features" ev=
"0" sft="0.00" pct="0.0%" /></coverage><coverage id="B" ev="$0" lo="" hi="" /></RepCostResults></Report></Response></Response
s></Report></Reports></ISOResponses>'



Please suggest me what mistake I am doing....

Thanks much.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Sep 23, 2007 5:52 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Looks to me you're adding a BLOB containing the XML to your tree.
Don't do that!
Don't use [CData] unless requested by the service.

Parse your BLOB into an XMLNS tree and insert the tree at the right place.
You should no longer have the XML escaped char problem after that.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
chris boehnke
PostPosted: Sun Sep 23, 2007 6:10 pm    Post subject: Reply with quote

Partisan

Joined: 25 Jul 2006
Posts: 369

fjb_saper wrote:
Looks to me you're adding a BLOB containing the XML to your tree.
Don't do that!
Don't use [CData] unless requested by the service.

Parse your BLOB into an XMLNS tree and insert the tree at the right place.
You should no longer have the XML escaped char problem after that.

Enjoy



If we include the data in place of string in CDATA(stylesheet) we are getting the response from the web service. If we dont include the CDATA in the above stylesheet, I am getting the error as bad request .

Please suggest me what actions can I take to avoid this.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Sep 23, 2007 7:11 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

chris boehnke wrote:
fjb_saper wrote:
Looks to me you're adding a BLOB containing the XML to your tree.
Don't do that!
Don't use [CData] unless requested by the service.

Parse your BLOB into an XMLNS tree and insert the tree at the right place.
You should no longer have the XML escaped char problem after that.

Enjoy



If we include the data in place of string in CDATA(stylesheet) we are getting the response from the web service. If we dont include the CDATA in the above stylesheet, I am getting the error as bad request .

Please suggest me what actions can I take to avoid this.


Again you are including a string / BLOB into a tree at the element level.

Try parsing your tree/BLOB into a TREE and include that TREE into your output TREE.

The only reason to be using a CDATA part here is if the webservice you are calling asks for a CDATA part. You did not confirm that this was the case. Nor did you confirm whether the service treated the element as a second message content... Escaped XML chars might be fine if the service retrieves the element as a string and then tries to parse said string...

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
chris boehnke
PostPosted: Mon Sep 24, 2007 6:33 am    Post subject: Reply with quote

Partisan

Joined: 25 Jul 2006
Posts: 369

Hi Guys,
When I write the response from the webservice to a queue, I dont see the '<' and '>' and in place of them I see '&lt' and '&gt' whereas I see the '<' and '>' when I write the response to a trace file.

Here I am posting the response what I am getting when I write it to a queue:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope 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">
<soap:Body>
<GetISODataResponse xmlns="http://air-worldwide.com/webservices/">
<GetISODataResult>&lt;ISOResponses&gt;&lt;ResponseHeader&gt;&lt;AIRTrack&gt;&lt;Instance&gt;633261700700731123;dhvasf1;AWS;2007-09-23T18:47:50.073-0400;/LM/W3SVC/1/Root/AWS-1-128350610491881421;&lt;/Instance&gt;&lt;Instance&gt;633261700700731123;dhvasf1;8089;2007-09-23T18:47:50.073-0400;Air.VL.ServiceHost.ServiceDriver.exe;AccumResponse;&lt;/Instance&gt;&lt;/AIRTrack&gt;&lt;runtimeinformation responseid="1258357258;633261700700731123" clientparam="UnknownUserHostAddress"&gt;&lt;time start="9/23/2007 6:47:49 PM" end="9/23/2007 6:47:50 PM" timespan="1.000" /&gt;&lt;count reportcount="1" errorcount="0" /&gt;&lt;/runtimeinformation&gt;&lt;/ResponseHeader&gt;&lt;Reports&gt;&lt;Report product="GetHomeValueData" version="5.2.0.24" timespan="1.000" sequence="11773" success="True" ASF.ErrorCode="0" ASF.ErrorMessage="" ASF.InfoMessage="Consolidated HomeValue with Engine" ASF.PercentCompleted="" ASF.StatusMessage="" ASF.Logfile=""&gt;&lt;Responses&gt;&lt;Response&gt;&lt;Report product="GetHomeValueData" xmlns:ns="urn:schemas-microsoft-com:xslt"&gt;&lt;Status&gt;COMPLETE&lt;/Status&gt;&lt;RequestID&gt;IQ-347593346-070206-103732&lt;/RequestID&gt;&lt;LocGUID&gt;{20377DF5-F7B5-DB11-B97A-000423786E34}&lt;/LocGUID&gt;&lt;StdAddress&gt;&lt;StreetAddress&gt;35 TROPHY LN&lt;/StreetAddress&gt;&lt;StreetNumber&gt;35&lt;/StreetNumber&gt;&lt;StreetNumberSuffix /&gt;&lt;StreetPrefix /&gt;&lt;StreetName&gt;TROPHY&lt;/StreetName&gt;&lt;StreetType&gt;LN&lt;/StreetType&gt;&lt;StreetSuffix /&gt;&lt;StreetUnit /&gt;&lt;City&gt;POINCIANA&lt;/City&gt;&lt;State&gt;FL&lt;/State&gt;&lt;ZIP5&gt;34759&lt;/ZIP5&gt;&lt;ZIP4&gt;3346&lt;/ZIP4&gt;&lt;ZIP9 /&gt;&lt;Zip&gt;34759&lt;/Zip&gt;&lt;County&gt;POLK&lt;/County&gt;&lt;/StdAddress&gt;&lt;PropertyInfo&gt;&lt;LocationName source="2"&gt;IQ-347593346-070206-103732&lt;/LocationName&gt;&lt;CreateDateTime source="2"&gt;02/06/2007 - 10:37:32 AM&lt;/CreateDateTime&gt;&lt;LivingSquareFeet est="1600" ppn="" gui="1600" source="2"&gt;1600&lt;/LivingSquareFeet&gt;&lt;YearBuilt est="1933" gui="1933" ppn="1933" source="2"&gt;1933&lt;/YearBuilt&gt;&lt;/PropertyInfo&gt;&lt;RepCostResults date="20070215" time="02/15/2007 - 9:05:16 AM" svc="C1023-L09190-A11637-T11350-C098-G040-S100-X100-P104-R100-U500:100-ms0-F13755-t10569-B10520-EB61204" build="4.6.0.20061204.1000" JobID="1466934"&gt;&lt;coverage id="A" ev="$158,927" lo="$110,151" hi="$229,301"&gt;&lt;est id="A00" name="TOTAL" ev="158,927" sft="99.33" pct="100.0%" /&gt;&lt;est id="A01" name="Site Preparation" ev="3,068" sft="1.92" pct="1.9%" /&gt;&lt;est id="A02" name="Excavation" ev="1,863" sft="1.16" pct="1.2%" /&gt;&lt;est id="A03" name="Foundation" ev="17,518" sft="10.95" pct="11.0%" /&gt;&lt;est id="A05" name="Floor Construction" ev="13,462" sft="8.41" pct="8.5%" /&gt;&lt;est id="A06" name="Ext Wall Const." ev="16,596" sft="10.37" pct="10.4%" /&gt;&lt;est id="A07" name="Ext Windows+Doors" ev="11,947" sft="7.47" pct="7.5%" /&gt;&lt;est id="A08" name="Roof Construction" ev="15,311" sft="9.57" pct="9.6%" /&gt;&lt;est id="A09" name="Inter. Construction" ev="7,838" sft="4.90" pct="4.9%" /&gt;&lt;est id="A10" name="Inter. Finishes" ev="9,619" sft="6.01" pct="6.1%" /&gt;&lt;est id="A11" name="Ceilings" ev="7,483" sft="4.68" pct="4.7%" /&gt;&lt;est id="A12" name="Specialties" ev="0" sft="0.00" pct="0.0%" /&gt;&lt;est id="A13" name="Floor Finish" ev="5,409" sft="3.38" pct="3.4%" /&gt;&lt;est id="A14" name="HVAC" ev="5,430" sft="3.39" pct="3.4%" /&gt;&lt;est id="A15" name="Plumbing" ev="12,433" sft="7.77" pct="7.8%" /&gt;&lt;est id="A16" name="Electrical" ev="3,934" sft="2.46" pct="2.5%" /&gt;&lt;est id="A17" name="OH+Fees+Profit" ev="27,018" sft="16.89" pct="17.0%" /&gt;&lt;est id="A90" name="Special Features" ev="0" sft="0.00" pct="0.0%" /&gt;&lt;/coverage&gt;&lt;coverage id="B" ev="$0" lo="" hi="" /&gt;&lt;/RepCostResults&gt;&lt;/Report&gt;&lt;/Response&gt;&lt;/Responses&gt;&lt;/Report&gt;&lt;/Reports&gt;&lt;/ISOResponses&gt;</GetISODataResult>
</GetISODataResponse>
</soap:Body>
</soap:Envelope>


Here I am posting the response when I write it to a Trace file where we can see '<' and '>'.

'<ISOResponses><ResponseHeader><AIRTrack><Instance>633261722891575327;dhvasf1;AWS;2007-09-23T19:2
4:49.157-0400;/LM/W3SVC/1/Root/AWS-5-128350633465447085;</Instance><Instance>633261722891419072;dhvasf1;8089;2007-09-23T19:24
:49.141-0400;Air.VL.ServiceHost.ServiceDriver.exe;AccumResponse;</Instance></AIRTrack><runtimeinformation responseid="1258357
258;633261722891419072" clientparam="UnknownUserHostAddress"><time start="9/23/2007 7:24:47 PM" end="9/23/2007 7:24:49 PM" ti
mespan="1.172" /><count reportcount="1" errorcount="0" /></runtimeinformation></ResponseHeader><Reports><Report product="GetH
omeValueData" version="5.2.0.24" timespan="1.172" sequence="11781" success="True" ASF.ErrorCode="0" ASF.ErrorMessage="" ASF.I
nfoMessage="Consolidated HomeValue with Engine" ASF.PercentCompleted="" ASF.StatusMessage="" ASF.Logfile=""><Responses><Respo
nse><Report product="GetHomeValueData" xmlns:ns="urn:schemas-microsoft-com:xslt"><Status>COMPLETE</Status><RequestID>IQ-34759
3346-070206-103732</RequestID><LocGUID>{20377DF5-F7B5-DB11-B97A-000423786E34}</LocGUID><StdAddress><StreetAddress>35 TROPHY L
N</StreetAddress><StreetNumber>35</StreetNumber><StreetNumberSuffix /><StreetPrefix /><StreetName>TROPHY</StreetName><StreetT
ype>LN</StreetType><StreetSuffix /><StreetUnit /><City>POINCIANA</City><State>FL</State><ZIP5>34759</ZIP5><ZIP4>3346</ZIP4><Z
IP9 /><Zip>34759</Zip><County>POLK</County></StdAddress><PropertyInfo><LocationName source="2">IQ-347593346-070206-103732</Lo
cationName><CreateDateTime source="2">02/06/2007 - 10:37:32 AM</CreateDateTime><LivingSquareFeet est="1600" ppn="" gui="1600"
source="2">1600</LivingSquareFeet><YearBuilt est="1933" gui="1933" ppn="1933" source="2">1933</YearBuilt></PropertyInfo><Rep
CostResults date="20070215" time="02/15/2007 - 9:05:16 AM" svc="C1023-L09190-A11637-T11350-C098-G040-S100-X100-P104-R100-U500
:100-ms0-F13755-t10569-B10520-EB61204" build="4.6.0.20061204.1000" JobID="1466934"><coverage id="A" ev="$158,927" lo="$110,15
1" hi="$229,301"><est id="A00" name="TOTAL" ev="158,927" sft="99.33" pct="100.0%" /><est id="A01" name="Site Preparation" ev=
"3,068" sft="1.92" pct="1.9%" /><est id="A02" name="Excavation" ev="1,863" sft="1.16" pct="1.2%" /><est id="A03" name="Founda
tion" ev="17,518" sft="10.95" pct="11.0%" /><est id="A05" name="Floor Construction" ev="13,462" sft="8.41" pct="8.5%" /><est
id="A06" name="Ext Wall Const." ev="16,596" sft="10.37" pct="10.4%" /><est id="A07" name="Ext Windows+Doors" ev="11,947" sft=
"7.47" pct="7.5%" /><est id="A08" name="Roof Construction" ev="15,311" sft="9.57" pct="9.6%" /><est id="A09" name="Inter. Con
struction" ev="7,838" sft="4.90" pct="4.9%" /><est id="A10" name="Inter. Finishes" ev="9,619" sft="6.01" pct="6.1%" /><est id
="A11" name="Ceilings" ev="7,483" sft="4.68" pct="4.7%" /><est id="A12" name="Specialties" ev="0" sft="0.00" pct="0.0%" /><es
t id="A13" name="Floor Finish" ev="5,409" sft="3.38" pct="3.4%" /><est id="A14" name="HVAC" ev="5,430" sft="3.39" pct="3.4%"
/><est id="A15" name="Plumbing" ev="12,433" sft="7.77" pct="7.8%" /><est id="A16" name="Electrical" ev="3,934" sft="2.46" pct
="2.5%" /><est id="A17" name="OH+Fees+Profit" ev="27,018" sft="16.89" pct="17.0%" /><est id="A90" name="Special Features" ev=
"0" sft="0.00" pct="0.0%" /></coverage><coverage id="B" ev="$0" lo="" hi="" /></RepCostResults></Report></Response></Response
s></Report></Reports></ISOResponses>'



Please suggest me what mistake I am doing....

Thanks much.
Back to top
View user's profile Send private message
chris boehnke
PostPosted: Mon Sep 24, 2007 6:56 am    Post subject: Reply with quote

Partisan

Joined: 25 Jul 2006
Posts: 369

Hi guys,
The ISO web service is setup to use strings. SOAP strings cannot contain '<' or '>' so they are replaced with '&lt;' and '&gt;'. Adding CDATA essentially turns the xml into a string.

I need to replace the encoded values with the unencoded values. Can anybody share your thoughts on replace the encoded values with the unencoded values.

I am trying to follow the below approach. Please suggest me whether I am going in the right direction.

-- Format xml by removing raw xml return from webservice --MQSeries.net
DECLARE MSG CHARACTER '';
SET MSG = CAST( InputRoot.BLOB.BLOB AS CHARACTER CCSID OutputRoot.MQMD.CodedCharSetId);
SET MSG = REPLACE ( MSG, '&lt;', '<');
SET MSG = REPLACE ( MSG, '&gt;', '>');

-- Add an XMLNS, and restore from the MSG
CREATE NEXTSIBLING OF OutputRoot.MQRFH2 DOMAIN 'XMLNS';
SET OutputRoot.XMLNS = MSG;

Thanks in advance.
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Sep 24, 2007 8:20 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

fjp_saper wrote:
Quote:
The only reason to be using a CDATA part here is if the webservice you are calling asks for a CDATA part

I'm not familiar with all of the requirements here, but this puzzled me. A CDATA section is just a useful XML notation for element content which contains ( or might contain ) markup. So I don't understand why a web service spec would care either way.
In other words
Code:
<element>string</element>
and
Code:
<element><![CDATA[string]]></element>
are identical.
Back to top
View user's profile Send private message
chris boehnke
PostPosted: Mon Sep 24, 2007 8:57 am    Post subject: Reply with quote

Partisan

Joined: 25 Jul 2006
Posts: 369

kimbert wrote:
fjp_saper wrote:
Quote:
The only reason to be using a CDATA part here is if the webservice you are calling asks for a CDATA part

I'm not familiar with all of the requirements here, but this puzzled me. A CDATA section is just a useful XML notation for element content which contains ( or might contain ) markup. So I don't understand why a web service spec would care either way.
In other words
Code:
<element>string</element>
and
Code:
<element><![CDATA[string]]></element>
are identical.


Hi guys,
The ISO web service is setup to use strings. SOAP strings cannot contain '<' or '>' so they are replaced with '&lt;' and '&gt;'. Adding CDATA essentially turns the xml into a string.

I need to replace the encoded values with the unencoded values. Can anybody share your thoughts on replace the encoded values with the unencoded values.

I am trying to follow the below approach. Please suggest me whether I am going in the right direction.

-- Format xml by removing raw xml return from webservice --MQSeries.net
DECLARE MSG CHARACTER '';
SET MSG = CAST( InputRoot.BLOB.BLOB AS CHARACTER CCSID OutputRoot.MQMD.CodedCharSetId);
SET MSG = REPLACE ( MSG, '&lt;', '<');
SET MSG = REPLACE ( MSG, '&gt;', '>');

-- Add an XMLNS, and restore from the MSG
CREATE NEXTSIBLING OF OutputRoot.MQRFH2 DOMAIN 'XMLNS';
SET OutputRoot.XMLNS = MSG;

Thanks in advance.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Sep 24, 2007 9:53 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

That's not going to work.

You can try using AsisElementContent, or however it's capitalized.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
chris boehnke
PostPosted: Mon Sep 24, 2007 11:05 am    Post subject: Reply with quote

Partisan

Joined: 25 Jul 2006
Posts: 369

jefflowrey wrote:
That's not going to work.

You can try using AsisElementContent, or however it's capitalized.


Hi Jeff,
Here is the request msg what I am sending to the webservice:


Message
Properties
MQMD
HTTPRequestHeader
XMLNS
Envelope
Body
\n
GetISOData
\n
xmlReqStg
\n\t\t\t\t\t\t<ISORequests>\n\t\t\t\t\t\t\t<RequestHeader>\n\t\t\t\t\t\t\t\t<AIR>\n\t\t\t\t\t\t\t\t\t<LoginID>ABCDEF_ws</LoginID>\n\t\t\t\t\t\t\t\t\t<Password>ABCD1234</Password>\n\t\t\t\t\t\t\t\t\t<LicenseKey>HFSJHSKAFHKASHFLKHAK</LicenseKey>\n\t\t\t\t\t\t\t\t</AIR>\n\t\t\t\t\t\t\t\t<HomeValue>\n\t\t\t\t\t\t\t\t\t<UserName>ABCD_ws</UserName>\n\t\t\t\t\t\t\t\t\t<Password>ABCD1234</Password>\n\t\t\t\t\t\t\t\t\t<LicenseKey>GSFGASLALFLAFLAFASDLHFKJSDH</LicenseKey>\n\t\t\t\t\t\t\t\t</HomeValue>\n\t\t\t\t\t\t\t</RequestHeader>\n\t\t\t\t\t\t\t<ISORequest>\n\t\t\t\t\t\t\t\t<Products>HomeValueRepCost</Products>\n\t\t\t\t\t\t\t\t<Addresses>\n\t\t\t\t\t\t\t\t\t<Address>\n\t\t\t\t\t\t\t\t\t\t<RequestID>IQ-347593346-070206-103732</RequestID>\n\t\t\t\t\t\t\t\t\t</Address>\n\t\t\t\t\t\t\t\t</Addresses>\n\t\t\t\t\t\t\t</ISORequest>\n\t\t\t\t\t\t</ISORequests>\n\t\t\t\t\t
\n
\n
LocalEnvironment
Environment
ExceptionList


Here is the response what I am getting from the webservice:

Message
Properties
HTTPRequestHeader
HTTPResponseHeader
XMLNS
Envelope
Body
GetISODataResponse
GetISODataResult
<ISOResponses><ResponseHeader><AIRTrack><Instance>633262427059013785;dhvasf1;AWS;2007-09-24T14:58:25.901-0400;/LM/W3SVC/1/Root/AWS-8-128351337599519899;</Instance><Instance>633262427058857539;dhvasf1;8089;2007-09-24T14:58:25.885-0400;Air.VL.ServiceHost.ServiceDriver.exe;AccumResponse;</Instance></AIRTrack><runtimeinformation responseid="1258357258;633262427058857539" clientparam="UnknownUserHostAddress"><time start="9/24/2007 2:58:25 PM" end="9/24/2007 2:58:25 PM" timespan="0.703" /><count reportcount="1" errorcount="0" /></runtimeinformation></ResponseHeader><Reports><Report product="HomeValueRepCost" version="5.2.0.24" timespan="0.703" sequence="537" success="True" ASF.ErrorCode="1" ASF.ErrorMessage=";Server was unable to process request. ---&gt; Object reference not set to an instance of an object." ASF.InfoMessage="Consolidated HomeValue with Engine" ASF.PercentCompleted="" ASF.StatusMessage="" ASF.Logfile=""><Responses><Response><ErrorReturn par0="NoHomeValueExc" par1="Server was unable to process request. ---&gt; Object reference not set to an instance of an object." par2=" at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)&#xD;&#xA; at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)&#xD;&#xA; at HomeValueWS2.GetHomeValueRepCost(String strInputXML)&#xD;&#xA; at AirReportProvider.cHomeValueReport.GetReport(XmlDocument reqData)" par3="&lt;ISORequests&gt;&lt;RequestHeader&gt;&lt;AIR&gt;&lt;LoginID&gt;WestfieldGroup_ws&lt;/LoginID&gt;&lt;Password&gt;west9919&lt;/Password&gt;&lt;LicenseKey&gt;QLAFKIUDJ%7DLWS%60WPCLAHABVKPT&lt;/LicenseKey&gt;&lt;/AIR&gt;&lt;HomeValue&gt;&lt;UserName&gt;WestfieldGroup_ws&lt;/UserName&gt;&lt;Password&gt;west9919&lt;/Password&gt;&lt;LicenseKey&gt;QLAFKIUDJ%7DLWS%60WPCLAHABVKPT&lt;/LicenseKey&gt;&lt;/HomeValue&gt;&lt;/RequestHeader&gt;&lt;ISORequest&gt;&lt;Products&gt;HomeValueRepCost&lt;/Products&gt;&lt;Addresses&gt;&lt;Address&gt;&lt;RequestID&gt;IQ-347593346-070206-103732&lt;/RequestID&gt;&lt;/Address&gt;&lt;/Addresses&gt;&lt;/ISORequest&gt;&lt;/ISORequests&gt;" /></Response></Responses></Report></Reports></ISOResponses>
LocalEnvironment
Environment
ExceptionList

Please let me know how to replace the '&lt' and '&gt' with '<' and '>' symbols.

Thanks much for your help.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2, 3  Next Page 1 of 3

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Calling an external webservice--problem with the request msg
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.