Using soap classic asp - weather.gov - issues

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akumar8k
    New Member
    • May 2007
    • 4

    Using soap classic asp - weather.gov - issues

    when i am excusing the below code i am getting the error.

    Error 1


    Code:
    −
    	<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    −
    	<SOAP-ENV:Body>
    −
    	<SOAP-ENV:Fault>
    <faultcode xsi:type="xsd:string">SOAP-ENV:Client</faultcode>
    <faultactor xsi:type="xsd:string"/>
    −
    	<faultstring xsi:type="xsd:string">
    Operation '' is not defined in the WSDL for this service
    </faultstring>
    <detail xsi:type="xsd:string"/>
    </SOAP-ENV:Fault>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    Error 2:
    Code:
              Error Type:
    Microsoft VBScript runtime (0x800A01A8)
    Object required: 'xd.getElementsByTagName(...).item(...)'
    /projects/soap/soap2.asp, line 58
    ]


    [code=asp]
    <%
    'Below I figure out what the current date is. The NWS SOAP Server wants a from date as xsd date or yyyy-mm-dd.

    datToday = Date()
    datToday="2008-03-17"
    'Response.Write datToday
    'Response.End
    dateday = Day(datToday)
    datemonth = Month(datToday)
    dateyear = Year(datToday)
    whatdate = dateyear & "-" & datemonth & "-" & dateday

    latitude="38.99 "
    longitude="77.0 1"
    numdays="7"

    'Page content set to xml and set to no cache.

    Response.CacheC ontrol = "no-cache"
    Response.Conten tType = "text/xml"

    'Below sets Microsoft xmlhttp object.

    Set ht = Server.CreateOb ject ("MSXML2.Server XMLHTTP")

    'Below compiles the SOAP request to NWS. You will need to replace "your latitude", "your longitude", and "your number of days" with your data. If you dont know you lat and long go to http://localhost/jason/geozip.asp. Note "your number of days" can be a value between 3 and 7 I beleive.

    tq = "<?xml version=""1.0"" encoding=""UTF-8"" standalone=""no "" ?>" _
    & "<SOAP-ENV:Envelope xmlns:SOAP-ENV=""http://schemas.xmlsoap .org/soap/envelope/"" xmlns:xsd=""htt p://www.w3.org/2001/XMLSchema"" xmlns:xsi=""htt p://www.w3.org/2001/XMLSchema-instance"" xmlns:si=""http ://soapinterop.org/xsd"" xmlns:tns=""htt p://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl"" xmlns:typens="" http://www.weather.gov/forecasts/xml/DWMLgen/schema/DWML.xsd"" xmlns:soap=""ht tp://schemas.xmlsoap .org/wsdl/soap/"" xmlns:wsdl=""ht tp://schemas.xmlsoap .org/wsdl/"" xmlns:SOAP-ENC=""http://schemas.xmlsoap .org/soap/encoding/"">" _
    & "<SOAP-ENV:Body>" _
    & "<mns:NDFDgenBy Day xmlns:mns=""htt p://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl"" SOAP-ENV:encodingSty le=""http://schemas.xmlsoap .org/soap/encoding/"">" _
    & "<latitude xsi:type=""xsd: decimal"">" & latitude & "</latitude>" _
    & "<longitude xsi:type=""xsd: decimal"">" & longitude & "</longitude>" _
    & "<startDate xsi:type=""xsd: date"">" & whatdate & "</startDate>" _
    & "<numDays xsi:type=""xsd: integer"">" & numdays & "</numDays>" _
    & "<format xsi:type=""type ns:formatType"" >12 hourly</format>" _
    & "</mns:NDFDgenByDa y>" _
    & "</SOAP-ENV:Body>" _
    & "</SOAP-ENV:Envelope>"

    'Below sends request

    ht.Open "POST", "http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.p hp", false
    ht.Send tq

    'Below opens the response and seperates out the xml from the SOAP envelope.

    htresult = ht.responsexml. xml


    Set xd = Server.CreateOb ject ("Microsoft.XML DOM")
    xd.async = "false"
    xd.loadXML(htre sult)

    'Response.Write htresult
    'Response.End

    htdude = xd.getElementsB yTagName("dwmlB yDayOut").item( 0).text

    'Code below inserts a link to the xsl style sheet. Modern browsers will do the rest.

    a = htdude
    pos = Instr(a,">")
    b = Left(a,pos) & "<?xml-stylesheet type=""text/xsl"" href=""forecast .xsl""?" & Mid(a,pos)
    Response.Write b

    Set xd = Nothing
    Set ht = Nothing
    %>[/code]
    Please help me.

    by,

    a2z info
    Last edited by jhardman; Mar 18 '08, 08:55 PM. Reason: put code in code tags. Please note button marked - #, removed signature
  • akumar8k
    New Member
    • May 2007
    • 4

    #2
    Hello,

    I got the solution but only one issue with forecast displaying issue.


    URL: http://weather4webs.com/code/default.asp

    Issue Is:

    # Error Type:
    Microsoft VBScript runtime (0x800A01A8)
    Object required: 'xd.getElements ByTagName(...). item(...)'
    /projects/soap/soap4.asp, line 54



    by,

    a2z info
    Last edited by jhardman; Mar 18 '08, 08:56 PM. Reason: removed excessive quote block and external link

    Comment

    Working...