hai, i have created a webservice file and made "web reference". in that i want to edit the .wsdl file and want to change the IP address....can anyone post me the coding? i want to put the wsdl file into an dataset and want to edit it...help me plz...its very urgent.......thanks in advance.....

Member Avatar for iamthwee

Well can't you just find the ip address you want to change and then just change it.

Well can't you just find the ip address you want to change and then just change it.

i need to change the ip address in runtime..i need the coding....i m trying in VB.net..help me....
dataset1.ReadXMLSchema( " c:\service.wsdl")
i tried the above line..but i cant..help me....

Member Avatar for iamthwee

I don't get what you mean. Sorrie. runtime? What difference does it make if you change it at runtime or later?

my coding is ...

dim ds as new dataset
ds.readxmlschema("c:\website2\sample\App_webreference\service.wsdl")
when i run the above coding in vb.net...i m getting the error "the supplied xmlinstance is a schema or contains an inline schema.this class cannot infer a schema for a schema"..help me plz

Member Avatar for iamthwee

Erm is your wsdl file valid xml scheme?

ERM means? my file is not an xmlschema...its wsdl file..which i got when i "add web reference" in vb.net.... the wsdl file has two ip address.i want to change that ip address during runtime.......help me...

Member Avatar for iamthwee

Can you post the contents of your wsdl file and hightlight the ip address you need to change.

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<s:element name="file_send">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="sam" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="file_sendResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="file_sendResult">
<s:complexType>
<s:sequence>
<s:element ref="s:schema" />
<s:any />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="ListOfFile">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="getfile" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="ListOfFileResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="ListOfFileResult">
<s:complexType>
<s:sequence>
<s:element ref="s:schema" />
<s:any />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="file_receive_store">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="ds1">
<s:complexType>
<s:sequence>
<s:element ref="s:schema" />
<s:any />
</s:sequence>
</s:complexType>
</s:element>
<s:element minOccurs="0" maxOccurs="1" name="str" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="file_receive_storeResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="file_receive_storeResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="file_sendSoapIn">
<wsdl:part name="parameters" element="tns:file_send" />
</wsdl:message>
<wsdl:message name="file_sendSoapOut">
<wsdl:part name="parameters" element="tns:file_sendResponse" />
</wsdl:message>
<wsdl:message name="ListOfFileSoapIn">
<wsdl:part name="parameters" element="tns:ListOfFile" />
</wsdl:message>
<wsdl:message name="ListOfFileSoapOut">
<wsdl:part name="parameters" element="tns:ListOfFileResponse" />
</wsdl:message>
<wsdl:message name="file_receive_storeSoapIn">
<wsdl:part name="parameters" element="tns:file_receive_store" />
</wsdl:message>
<wsdl:message name="file_receive_storeSoapOut">
<wsdl:part name="parameters" element="tns:file_receive_storeResponse" />
</wsdl:message>
<wsdl:portType name="ServiceSoap">
<wsdl:operation name="file_send">
<wsdl:input message="tns:file_sendSoapIn" />
<wsdl:output message="tns:file_sendSoapOut" />
</wsdl:operation>
<wsdl:operation name="ListOfFile">
<wsdl:input message="tns:ListOfFileSoapIn" />
<wsdl:output message="tns:ListOfFileSoapOut" />
</wsdl:operation>
<wsdl:operation name="file_receive_store">
<wsdl:input message="tns:file_receive_storeSoapIn" />
<wsdl:output message="tns:file_receive_storeSoapOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ServiceSoap" type="tns:ServiceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="file_send">
<soap:operation soapAction="http://tempuri.org/file_send" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="ListOfFile">
<soap:operation soapAction="http://tempuri.org/ListOfFile" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="file_receive_store">
<soap:operation soapAction="http://tempuri.org/file_receive_store" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="ServiceSoap12" type="tns:ServiceSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="file_send">
<soap12:operation soapAction="http://tempuri.org/file_send" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="ListOfFile">
<soap12:operation soapAction="http://tempuri.org/ListOfFile" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="file_receive_store">
<soap12:operation soapAction="http://tempuri.org/file_receive_store" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Service">
<wsdl:port name="ServiceSoap" binding="tns:ServiceSoap">
<soap:address location="http://172.31.15.70/testwebserver/Service.asmx" />
</wsdl:port>
<wsdl:port name="ServiceSoap12" binding="tns:ServiceSoap12">
<soap12:address location="http://172.31.15.70/testwebserver/Service.asmx" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

"http://172.31.15.70/testwebserver/Service.asmx"...want to change this whole address to "http://170.30.19.45/destination/Service.asmx"

Member Avatar for iamthwee

Er, have you heard of string.replace?

my coding is ...

dim ds as new dataset
ds.readxmlschema("c:\website2\sample\App_webreference\service.wsdl")
ds.tables(0).rows(0).item(0)=ds.tables(0).rows(0).item(0).tostring.replace(ds.tables(0).rows(0).item(0),http://172.13.15.65/test12/service.asmx)

when i run the above coding in vb.net...i m getting the error "the supplied xmlinstance is a schema or contains an inline schema.this class cannot infer a schema for a schema".
i want to read that wsdl file content to an dataset.....and replace it into the dataset...help me plz

Member Avatar for iamthwee

well this error,

the supplied xmlinstance is a schema or contains an inline schema.this class cannot infer a schema for a schema

seems to be saying your file has a schema within a schema. If your file isn't legitimate xml then it won't get any further?

To be honest I'm just guessing. Maybe someone else can help you.

Also another spot:-

replace(ds.tables(0).rows(0).item(0),"http://172.13.15.65/test12/service.asmx")

Don't you need quotes around the web adress?

i dt need the quotes......

Member Avatar for iamthwee

i dt need the quotes......

Are you sure, all the examples using string replace have quotes.

Karan: I really don't know VB that well, but don't you have to put the ip address in quotes?

ds.tables(0).rows(0).item(0)=ds.tables(0).rows(0).item(0).tostring.replace(ds.tables(0).rows(0).item(0), "http://172.13.15.65/test12/service.asmx")

ok...i wwant that matter only....with quotes or without quotes.... no problem...can u help me?

wait sirs..i m going for DINNER...we will continue...at 8.............plz

hello ...anyone help me?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.