Showing posts with label webservice. Show all posts
Showing posts with label webservice. Show all posts

Tuesday, March 20, 2012

Problem whith insert into SQL server from webservice

My webservice is suppoed to insert a row into my SQL server database. Al columns are varchar(String). When we insert with digits everything is ok, but when we try letters as parameters i get this error message:

"An unhandled exception of type 'System.Web.Services.Protocols.SoapException' occurred in system.web.services.dll

Additional information: Server was unable to process request. --> The name 'Bob' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted."

Any idea?Show the code that is creating the INSERT statement. Presuming Bob is a string you are trying to insert, are you either using parameters (best solution) or alternately, enclosing the variable in quotes in the resulting string.|||I solved the problems by using parameters instead. Thank you! :)|||Glad to hear it. Parameters eliminate all sorts of problems, in addition to making your application much more secure.

Monday, February 20, 2012

Problem using an AXIS Webservice

Helo:

I am trying to use an axis webservice as a datasource to a report.

I have an error : Failed to prepare web request for the specified URL

When I run the query in query designer.

I test the webservice in a windows aplication and works fine. I think that the problem I have is with the target namespace/url

I am using the folowing data in the report:

datasource conection string: http://191.158.134.200:8080/CatalogWS/services/CatalogWebService

dataset query:

<Query>

<Method Namespace="urn:CatalogWebService" Name="findArticulos"/>

<SoapAction>urn:CatalogWebService/findArticulos</SoapAction>

</Query>

And here is a fragment (the header) of the wsdl of the webservice:

http://191.158.134.200:8080/CatalogWS/services/CatalogWebService?wsdl

<wsdl:definitions targetNamespace="urn:CatalogWebService" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="urn:CatalogWebService" xmlns:intf="urn:CatalogWebService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="http://core.catalog.cepre.opp.gub.uy" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

- <wsdl:types>...

Someone can help me, to find the right way ?

Tanks!!

I had resolved the conection problem, the problem was the parameters of the method.

The problem now is that the dataset result is not the actual data, there are 3 columns and one row:

columns: href ns1 encodingStyle

values: #0 urn:CatalogWebService http://schemas.xmlsoap.org/soap/encoding/

The data type returned by the ws method is a complex object with an array inside, is this the problem ?

Tanks for any help!

|||

Yes the complex object may be the issue.

The following article may give you some ideas on how to use the element path and apply type casting in your xml data extension query: http://msdn.microsoft.com/library/en-us/dnsql90/html/RepServXMLDS.asp

-- Robert

|||

Robert

the link you send me is about Charts and have no information related to xml. Please review that.

Tanks.

|||

Sorry for the incorrect link. I fixed it.

-- Robert

Problem using an AXIS Webservice

Helo:

I am trying to use an axis webservice as a datasource to a report.

I have an error : Failed to prepare web request for the specified URL

When I run the query in query designer.

I test the webservice in a windows aplication and works fine. I think that the problem I have is with the target namespace/url

I am using the folowing data in the report:

datasource conection string: http://191.158.134.200:8080/CatalogWS/services/CatalogWebService

dataset query:

<Query>

<Method Namespace="urn:CatalogWebService" Name="findArticulos"/>

<SoapAction>urn:CatalogWebService/findArticulos</SoapAction>

</Query>

And here is a fragment (the header) of the wsdl of the webservice:

http://191.158.134.200:8080/CatalogWS/services/CatalogWebService?wsdl

<wsdl:definitions targetNamespace="urn:CatalogWebService" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="urn:CatalogWebService" xmlns:intf="urn:CatalogWebService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="http://core.catalog.cepre.opp.gub.uy" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

- <wsdl:types>...

Someone can help me, to find the right way ?

Tanks!!

I had resolved the conection problem, the problem was the parameters of the method.

The problem now is that the dataset result is not the actual data, there are 3 columns and one row:

columns: href ns1 encodingStyle

values: #0 urn:CatalogWebService http://schemas.xmlsoap.org/soap/encoding/

The data type returned by the ws method is a complex object with an array inside, is this the problem ?

Tanks for any help!

|||

Yes the complex object may be the issue.

The following article may give you some ideas on how to use the element path and apply type casting in your xml data extension query: http://msdn.microsoft.com/library/en-us/dnsql90/html/RepServXMLDS.asp

-- Robert

|||

Robert

the link you send me is about Charts and have no information related to xml. Please review that.

Tanks.

|||

Sorry for the incorrect link. I fixed it.

-- Robert