Web Connection
Returning a response to webservice caller
Gravatar is a globally recognized avatar based on your email address. Returning a response to webservice caller
  Simon
  All
  Oct 10, 2018 @ 03:40pm

Hi Rick

We have built a webservice that works really well when we test it.

We can send data to webservice and receive a proper xml response (as per client specs) from webservice and it seems really fast and reliable.

It is a REST service and only transmits data.

We have set the following properties :

JsonService.IsRawResponse = .T.  && stops "true" being added to response
Response.ContentType = "text/xml"  

Our SOAP response is via :

Response.Write(lcXML)

The client can send data to us fine but is struggling to receive a valid response and has the following error : “Object reference not set to an instance of an object.”

We think this is a setting somewhere but cannot find it.

Any thoughts?

Cheers

Simon

Gravatar is a globally recognized avatar based on your email address. re: Returning a response to webservice caller
  Rick Strahl
  Simon
  Oct 10, 2018 @ 09:18pm

The error message you are seeing comes from .NET, but I'm not sure where your code is hitting that.

I'm not sure based on what you're describing I understand what you actually are doing. You say it works, but yet you say it fails with that error so I'm not sure what that means.

You probably will have to post your code.

+++ Rick --

Gravatar is a globally recognized avatar based on your email address. re: Returning a response to webservice caller
  Simon
  Rick Strahl
  Oct 11, 2018 @ 04:06am

Hi Rick

When we test our Web Connection web service - it works fine. We are using VFP to call and to receive.

When the client calls our webservice they get the error at their end.

Our function called by the webservice is very simple :


FUNCTION SomeFunction
	
	JsonService.IsRawResponse = .T.
	Response.ContentType = "text/xml"    
	
	lcXML = request.form()  && form buffer

	STRTOFILE(lcXML,"filename.xml")
	lRetval = ReadXMLAndBuldReturnString()

	Response.Write(lRetval)

Is there a better setting than the

Response.ContentType = "text/xml"  

We believe they are using Visual Studio

Thanks

Simon

Gravatar is a globally recognized avatar based on your email address. re: Returning a response to webservice caller
  Rick Strahl
  Simon
  Oct 11, 2018 @ 12:20pm

Based on what you're showing the error is on their end not your's. They are likely getting the data and get an error parsing it.

If you're returning the data and you're sure they are actually hitting your server correctly and returning the same data, the error is on the other end.

+++ Rick ---

© 1996-2024