I have written a SOAP server in PHP using http://code.google.com/p/php-wsdl-creator/downloads/list
My client is in Dynamics CRM Online plugin written in C#
Everything works fine on my testing website, however when I send the SOAP server across to the clients web host, they have uploaded the files, but I'm getting the following error returned:
SoapServer::SoapServer(): 'soap_version' option must be SOAP_1_1 or SOAP_1_2
I believe this is a configuration issue on their server (they had to install a SOAP module for this) but I don't know where to look/advise to sort this out.
For reference, my C# class references the SOAP server in a web reference. I have added the following line, trying both 11 and 12 but to no avail:
soap.SoapVersion = System.Web.Services.Protocols.SoapProtocolVersion.Soap11;
When I look at the phpinfo page, my test server has the line '--enable-soap' '--with-xsl=/usr in the Configure Command section, where as the web hosts version doesn't but it does have the line /etc/php.d/soap.ini in Additional .ini files parsed - would this cause any issue? I don't know anything about configuring php servers.
I had the same problem within the php-wsdl-createor-framework.
Their patch on https://code.google.com/p/php-wsdl-creator/ was to change line 434 in class.phpwsdl.php
from
// SOAP server options
$this->SoapServerOptions=Array(
'soap_version' => SOAP_1_1|SOAP_1_2,
'encoding' => 'UTF-8',
'compression' => SOAP_COMPRESSION_ACCEPT|SOAP_COMPRESSION_GZIP|9
);
to
// SOAP server options
$this->SoapServerOptions=Array(
'soap_version' => (defined('SOAP_1_2'))?SOAP_1_2:SOAP_1_1,
'encoding' => 'UTF-8',
'compression' => SOAP_COMPRESSION_ACCEPT|SOAP_COMPRESSION_GZIP|9
)
Hope it helps anyone
Try setting the soap_version option in the SoapServer constructor (PHP). For example:
$server = new SoapServer("some.wsdl", array('soap_version' => SOAP_1_2));
Related
I built this creating-web-apis-using-asp-net-and-mysql-in-5-minutes
The api runs fine on my local machine windows 10 with visual studio 2017 enterprise. I have a centos box running on VMware in another location this is where my MySQL database is. When I run the api on my local machine I use a connection string with a FQDN and the api runs fine. FYI the api also has a method without database access that basically sends back a json string ["value1","value2"] both this and the one that gets a user from MySQL work fine on local machine.
Next I set it up as a service on the Centos box and set up apache to proxy to the kestrel web server at localhost:5000 using these instructions Host ASP.NET Core on Linux with Apache. my Apache virtual host config is the same as the one in the example except no server alias and no logging. I didn't want a server alias and the logging commands stopped the service from starting. I also needed to upgrade apache from the Centos's repo apache 2.4.6 to Apache 2.4.36 I think.
I did this using a third party repo because RequestHeader set "X-Forward-Proto" expr=%{REQUEST SCHEME} needed Apache 2.4.10 or above.
It should be stated that I used my own database and not the example one it is basic just returns user info like uname etc.
If I run http://MyFQDN/api/values I get the desired response.
If run http://MyFQDN/api/users/1 which when run on my local machine while debugging returns a json string with the correct information using a MySQL connection string with a FQDN and not localhost:3306 or 127.0.0.1:3306 as the server in the connection string. When I try it on the Linux box no go.
Instead I get the infamous http 500 error which I believe means that program is not running correctly the only difference here is the MySQL connection string or there is something else.
in the demo it says
Some values (for example, SQL connection strings) must be escaped for the configuration providers to read the environment variables. Use the following command to generate a properly escaped value for use in the configuration file
However I have tried several times using the example
systemd-escape … see demo for exact syntax as it doesn't escape well here funny.
I believe if I had a properly escaped MySQL connection string that would work on kestrel in the Centos box it might work.
This is in appsettings.production.json
"ConnectionStrings": {
"DevDatabase": "Server=127.0.0.1;Port=3306;Database=nameOfDatabase;Uid=svcuser;Pwd=Password;"
},
Any help would be appreciated
Thanks
________--------UPDATE
So I am trying to attach the visual studio debugger to the web-api using ssh which I believe should let me walk through the code while it is running on the Centos box and find the error.
Here is link to instructions to do just that (FYI no luck yet) Link to instructions
Any advice on this or some other help always accepted
Thanks
use the instructions under my update. I am now able to run the web-api on the Linux box through any browser and step through the code on my machine …….
I have a null object at my connection string from the .json file.
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<sPPContext>(options =>
options.UseMySQL(Configuration.GetConnectionString("changedButFrom.json")));
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
services.Configure<ForwardedHeadersOptions>(options =>
{
options.ForwardedHeaders =
ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
});
}
the error happens on the line where I put changedButFrom.json I am confident it is the escaping of the connection string that is causing the problem before I wasn't sure what the problem was
Great tool
I've got an nusoap based wsdl on Linux which I'm trying to convert to a windows host.
The host is freshly installed, so any misconfiguration can apply for the issue.
The Host is running IIS7.5
PHP 5.5.3.8
MySQL 5.0.11
The soap request gets the right data out of the mysql database, but the application gives an error message: The XML-document (1, 542) contains an error.
And also The given type is not recognized: name=Data, namespace=http://www.my-domain.com/soap/GetData, at
I'm trying to get the raw result out of IIS but can't get it to work.
I've tried many suggestions found by google-ing, but none works.
Any help is appreciated.
I've ended up making a new rest API and used that instead of the Linux solution used before.
Firstly let me describe my setup.
I have a REST Telerik Reporting service. The service operates with TRDX file (have a requirement to have reports in this template format). I also have a console application, which is periodically started by a windows service. This console application uses ReportProcessor class to print reports directly to a printer.
Now the problem.
ReportProcessor throws an exception when trying to access the reports using UriReportSource, when these report files are hosted in IIS together with the REST Reporting service. Browsing and Anonymous Authentication are enabled on IIS for the Reports folder. The error that's thrown is:
The remote server returned an error: (404) not found.
However reports are printed when TRDX files are located in the same folder as the console application.
Solved my own question by trial and error.
My reports were located in the REST service's subdirectory. So I was trying to set the Uri to the reports URL something like this:
UriReportSource reportSource = new UriReportSource {
Uri = "http://localhost/myTelerikRESTService/Reports/samplereport.trdx"
};
And I was obviously getting 404 error since the request to the that path would be handled by the service.
Trying to specify a physical path (c:\inetpub\wwwroot\myTelerikService\Reports\samplereport.trdx) also ended up in error: something like the path format is not supported.
Finally I've tried this Uri: /inetpub/wwwroot/myTelerikService/Reports/samplereport.trdx, that maps to the physical location.
And it worked!
EDIT:
I really should've read this https://www.w3.org/Addressing/URL/uri-spec.html before working on this issue. Apparently I had no firm understanding of what a URI is! Feeling really dumb now.....
i want to debug my program but i can't host my silverlight project in VS 2010
here is the message that the VS send to me:
"the Silverlight project you are about to debug uses web service. Call to the web service will fail unless the Silverlight is host and launched from the same web project contains the web service"
when I search about it in the web i saw that the problem is that I'm not doing it local
so when I tried to change this line
endpoint address="http://xxx.xx.x.x/WebService/Service1.svc"
to
endpoint address="http://localhost/WebService/Service1.svc"
on this file:
ServiceReferences.ClientConfig
update!!
i tried now to do it like this:
endpoint address="http://localhost:54502/Service1.svc"
and i got and error that says:
the remote server returned an error:NotFound
here:
public int EndAddParticipant(System.IAsyncResult result) {
object[] _args = new object[0];
int _result = ((int)(base.EndInvoke("AddParticipant", _args, result)));
return _result;
what should i do to change it?
i saw that i need to turn on the debug in web.config file but it was already on.
You didn't explain well so here are a bunch of answers:
When you created your solution, you should have told it to host in a web site.
You can do this after the fact but it is a lot of work (for a new guy), you're better off starting over and copying your code from your silverlight project.
If you did but you are trying to connect to another web site as your web service, you will have to implement a Cross Domain configuration file. This opens a big security hole though.
If you have the 2 projects, but your issue is just the "ServiceReferences.ClientConfig" file not pointing the the right server, you need to include the PORT when debugging locally. It should look something like this:
http://localhost:12345/Service1.svc
Where 12345 is the port of your local web service. You can find this out by looking at the "Web" tab of your project properties.
Hope one of these does it. If not, please provide a little more info, like all the important stuff behind the phrase, "it didn't work"!
I'm trying to access my Google spreadsheets using the GData API. I have followed the example which looks like:
var service = new SpreadsheetsService("myTest");
service.setUserCredentials(username, password);
var query = new SpreadsheetQuery();
var feed = service.Query(query);
This should return a feed with a list of spreadsheets. However this fails with:
Google.GData.Client.GDataRequestException: Execution of request failed: http://spreadsheets.google.com/feeds/spreadsheets/private/full ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
When I try the above link directly in my browser I'm able to download the feed, as long as I'm logged in into my Google account.
Some further information:
I'm not behind a firewall
I have checked my username (maurits.rijk at gmail.com) and password several times
I am using Mandriva in VirtualBox on a MacBook
All my code is compiled with Mono
I tried the same functionality in Java on OS-X. That code runs as expected.
Looks like a Mono problem to me.
Could you test with fiddler to test if your call reach the server?
I found the problem and solution on Google code, Issue 88 as comment 8.
In short, using
mozroots --import --sync --quiet
solves this problem. For me it now works.