标签: web-services

JAX-WS Netbeans 如何启用压缩 Web 服务客户端

我在 Netbeans 7.1.2 中使用了 Web 服务客户端向导,但是当我尝试调用其中一个方法时,我收到以下错误:

javax.xml.ws.soap.SOAPFaultException:异常:未启用压缩,此 Web 服务期望客户端支持 GZIP、Deflate 压缩

生成的骨架文件很多,我无法弄清楚如何启用压缩。有人可以建议吗?

非常感谢

compression netbeans web-services jax-ws

0
推荐指数
1
解决办法
4077
查看次数

RESTful Web 服务 - 多种 POST 方法。如何从android应用程序中调用特定的一个?

我使用 RESTful 方法编写了一个 Web 服务,并且有不止一种接受 POST 请求的方法,例如:

@Path("/user")
class User{
    @POST
    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
    @Produces(MediaType.APPLICATION_JSON)
    public UserMasterDto getUserDetails(MultivaluedMap<String, String> userParams) {
         // other stuff..
    }

    @POST
    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
    @Produces(MediaType.APPLICATION_JSON)
    public UserMasterDto getUserDetails2(MultivaluedMap<String, String> userParams){
         // other stuff..
    }
}
Run Code Online (Sandbox Code Playgroud)

getUserDetails2我想从 Android 应用程序中调用特定的方法。我需要做什么?

android web-services jax-rs

0
推荐指数
1
解决办法
4815
查看次数

在会话中保存数组 C# 错误

我正在尝试在会话中保存数组并尝试将其恢复。以下是代码。但是当我调用 WebMethod 时出现以下错误。我正在使用c#。VS2010

错误:

System.NullReferenceException:未将对象引用设置为对象的实例。在 C:\Users\uydarp\Documents\Visual Studio 2010\Projects\xmlRW1\xmlRW1\Service1.asmx.cs 中的 xmlRW1.Service1.logic() 处:第 86 行

[WebMethod]
    public int logic()
    {
        int[] myArray = { 1,2,3,4};
        Session["MyArray"] = myArray; 

        int[] myArray2 = (int[])Session["MyArray"];
        int firstElement = myArray2[0];

        return firstElement;
    }
Run Code Online (Sandbox Code Playgroud)

c# asp.net web-services

0
推荐指数
1
解决办法
98
查看次数

QuickBooks Web 连接器使用 PHP SOAP 服务器进行身份验证

我只是想了解 QBWC 验证过程。我正在尝试用 PHP 构建一个真正的基本 SOAP 服务器,该服务器仅对 QBWC 请求进行身份验证。

这是我的 WSDL:

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://developer.intuit.com/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="http://developer.intuit.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">WebService for QBFS created using ASP.NET to troubleshoot QuickBooks WebConnector</wsdl:documentation>
<wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://developer.intuit.com/">
        <s:element name="serverVersion">
            <s:complexType />
        </s:element>
        <s:element name="serverVersionResponse">
            <s:complexType>
                <s:sequence>
                    <s:element minOccurs="0" maxOccurs="1" name="serverVersionResult" type="s:string" />
                </s:sequence>
            </s:complexType>
        </s:element>
        <s:element name="clientVersion">
            <s:complexType>
                <s:sequence>
                    <s:element minOccurs="0" maxOccurs="1" name="strVersion" type="s:string" />
                </s:sequence>
            </s:complexType>
        </s:element>
        <s:element name="clientVersionResponse">
            <s:complexType>
                <s:sequence>
                    <s:element minOccurs="0" maxOccurs="1" name="clientVersionResult" type="s:string" …
Run Code Online (Sandbox Code Playgroud)

php quickbooks soap web-services intuit-partner-platform

0
推荐指数
1
解决办法
2854
查看次数

WCF 错误 - (413) 请求实体太大

我有 2 个 WCF 服务一起工作。一种是类库,另一种是Web服务。

到目前为止它运行良好。但如果我尝试发送大量数据,它会抛出 413 错误......

An exception was thrown: The remote server returned an error: (413) Request Entity Too Large.

下面是 web.config 文件 -

对于类库-

    <add key="SMTP" value ="dummy"/>
    <add key="BookingEmailFrom" value ="dummy"/>
    <add key="BookingEmailToWBD" value ="dummy"/>

  </appSettings>
  <connectionStrings/>
  <system.web>
    <compilation debug="true" targetFramework="4.0"/>
    <!--
        The <authentication> section enables configuration 
        of the security authentication mode used by 
        ASP.NET to identify an incoming user. 
    -->
    <authentication mode="Windows"/>
    <!--
        The <customErrors> section enables configuration 
        of what to do if/when an …
Run Code Online (Sandbox Code Playgroud)

web-services web http-status-code-413

0
推荐指数
1
解决办法
7224
查看次数

从 Node.js 调用 SOAP 服务

我刚刚开始使用 Node.js,并且尝试使用 Node Soap 扩展来使用 SOAP 服务。我现在只是使用示例服务调用,但似乎无法启动并运行它。

var soap = require('soap');
var fs = require('fs');

reqURL = fs.readFile('www.webservicex.net/stockquote.asmx?WSDL', 'UTF-8', function(err, data){
    if(err) console.log(err)
        soap.createClient(data, function(err, client){
            client.StockQuote.StockQuoteSoap.GetQuote({symbol:'NKE'}, function(err, response){
                if(err) console.log(err);
                    console.log(response);
            });
            console.log('Here is the SOAP sent to ' + data + client.lastrequest);
        });
});
Run Code Online (Sandbox Code Playgroud)

这是我收到的错误:

{ [Error: ENOENT, open 'c:\dev\workspace\WebDevClass\node\www.webservicex.net\st
ockquote.asmx?WSDL']
  errno: -4058,
  code: 'ENOENT',
  path: 'c:\\dev\\workspace\\WebDevClass\\node\\www.webservicex.net\\stockquote.
asmx?WSDL' }
fs.js:491
  binding.open(pathModule._makeLong(path),
          ^
TypeError: path must be a string
    at TypeError (native)
    at Object.fs.open (fs.js:491:11)
    at Object.fs.readFile (fs.js:262:6)
    at …
Run Code Online (Sandbox Code Playgroud)

javascript soap web-services node.js

0
推荐指数
1
解决办法
5458
查看次数

如何在 WPF 项目中公开 Restful 服务

我是个新手。我正在使用 Visual Studio 2010 作为桌面应用程序,我需要将其中的一些数据公开到我的 LAN 中的网站,但我不知道如何操作。

我创建了一个 MVC2 项目,创建了一个新控制器,并且可以公开一个简单的“helloWorld”服务,如下所示:

[HttpGet]
    public JsonResult HolaMundo()
    {
        List<object> movies = new List<object>();

        movies.Add(new { Title = "Ghostbusters", Genre = "Comedy", Year = 1984 });
        movies.Add(new { Title = "Gone with Wind", Genre = "Drama", Year = 1939 });
        movies.Add(new { Title = "Star Wars", Genre = "Science Fiction", Year = 1977 });

        return Json(movies, JsonRequestBehavior.AllowGet);
    }
Run Code Online (Sandbox Code Playgroud)

它有效:显示服务工作的图片

除了在 wpf 项目中我该怎么做?(或者我如何使用 wpf 项目中的这个 mvc 项目来获得相同的结果?)

我只是迷失在信息的海洋中,我什至不知道如何寻找解决问题的方法。

感谢您的耐心等待,祝您有愉快的一天。

c# asp.net wpf web-services

0
推荐指数
1
解决办法
8910
查看次数

如何调用简单的Web服务

我有一个名为 Service1.cs 的 C# 文件,其中包含以下内容:

public class Service1 : System.Web.Services.WebService
{ 
    [System.Web.Services.WebMethod]
    public static String testMethod()
    {
       return "Hello";
    }
}
Run Code Online (Sandbox Code Playgroud)

我将这段代码放入我的 helloworld.html 文件中:

<WebService Language="c#" Codebehind="Service1.cs"
    Class="Service1.Service1">
Run Code Online (Sandbox Code Playgroud)

我的目录位于http://localhost:8000/,其中包含 helloworld.html 的链接和下载 Service1.cs 的链接

我必须访问哪个 url 才能访问 testMethod() 返回的字符串?

我尝试过http://localhost:8000/helloworld/testmethodhttp://localhost:8000/helloworld/Service1/testmethod,但我不知道如何获取从 Web 服务返回的字符串值。

提前致谢。

c# asp.net web-services

0
推荐指数
1
解决办法
1万
查看次数

如何在网页上运行 Swing 应用程序?

我在 Netbeans 中创建了一个 Swing 应用程序,它基本上是一个聊天系统(使用套接字编程在多个客户端和服务器之间)。

现在我想在网页上运行这个应用程序。这可以在不更改任何代码的情况下实现吗?

java sockets swing web-services

0
推荐指数
1
解决办法
478
查看次数

java中使用https的Rest api

当我Restservices使用 java等创建时GETPOST我请求它们使用 http protocol. 当我使用 https 时,就会出现错误。

例如: http://localhost:8080/demorest/webapi/aliens工作正常。

但是当我使用相同的查询时https

https://localhost:8080/demorest/webapi/aliens
Run Code Online (Sandbox Code Playgroud)

我收到错误site can not provide secured connection

需要进行哪些修改才能使它们与https.

java rest https web-services rest-security

0
推荐指数
1
解决办法
9416
查看次数