XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
ling shenSubject: Can I pass a parameter/vaiable as the address in ddtek:wscall?
Author: ling shen
Date: 15 Jul 2008 04:22 PM
When doing wscall, I need to pass the host address as a parmeter. So I tried to use a variable $WebServiceAddress to replace "http://www.ejse.com/WeatherService/Service.asmx".

*************************************************************
declare variable $WebServiceHost as xs:string := "http://12.34.567.89:8888/";

let $WebServiceAddress :=concat($WebServiceHost, "WeatherService/Service.asmx")
return

ddtek:wscall(
<ddtek:location
address=$WebServiceAddress
soapaction="http://ejse.com/WeatherService/GetWeatherInfo"/>,
<tns:UserCreds xmlns:tns="http://ejse.com/WeatherService/">
<tns:UserName>marypelle@acme.org</tns:UserName>
<tns:Password>30Mp75Y8p49s</tns:Password>
</tns:UserCreds>,
<tns:GetWeatherInfo xmlns:tns="http://ejse.com/WeatherService/">
<tns:zipCode>01803</tns:zipCode>
</tns:GetWeatherInfo>
)

*********************************************************
I am getting:
XQQueryException: [DataDirect][XQuery][err:XPST0003]Error at line 10, column 9. No starting quote found for attribute value.
Line: 10
Column: 9
ErrorCode: {http://www.w3.org/2005/xqt-errors}XPST0003
VendorCode: P0007
com.ddtek.xquery3.XQQueryException: [DataDirect][XQuery][err:XPST0003]Error at line 10, column 9. No starting quote found for
attribute value.

If I add the string quote around the variable like this address="$WebServiceAddress",
it will use the literal "$WebServiceAddress" as address, which is not right.

Is there a way to use a vaiable as the address in ddtek:wscall?


Please advise.

Thank you,


Ling



Postnext
Minollo I.Subject: Can I pass a parameter/vaiable as the address in ddtek:wscall?
Author: Minollo I.
Date: 15 Jul 2008 04:32 PM
Try:
ddtek:wscall(
<ddtek:location
address="{$WebServiceAddress}"
soapaction="http://ejse.com/WeatherService/GetWeatherInfo"/>,
<tns:UserCreds xmlns:tns="http://ejse.com/WeatherService/">
<tns:UserName>marypelle@acme.org</tns:UserName>
<tns:Password>30Mp75Y8p49s</tns:Password>
</tns:UserCreds>,
<tns:GetWeatherInfo xmlns:tns="http://ejse.com/WeatherService/">
<tns:zipCode>01803</tns:zipCode>
</tns:GetWeatherInfo>
)

Posttop
ling shenSubject: Can I pass a parameter/vaiable as the address in ddtek:wscall?
Author: ling shen
Date: 15 Jul 2008 06:55 PM
It works.

Thank you!

 
Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.