Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/359.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache cxf java first和SOAP模块npm_Java_Node.js_Web Services_Maven_Soap - Fatal编程技术网

Apache cxf java first和SOAP模块npm

Apache cxf java first和SOAP模块npm,java,node.js,web-services,maven,soap,Java,Node.js,Web Services,Maven,Soap,我已经部署了一个cxf jaxws javafirst maven项目,其默认方法是:HelloWorld.sayHiString text 另一方面,我用soap模块在Nodejs上实现了一个soap客户机 var express = require('express') var app = express() //soap module var soap = require('soap'); //url of the wsdl var url = 'http://localhost:80

我已经部署了一个cxf jaxws javafirst maven项目,其默认方法是:HelloWorld.sayHiString text

另一方面,我用soap模块在Nodejs上实现了一个soap客户机

var express = require('express')
var app = express()
//soap module
var soap = require('soap');
//url of the wsdl
var url = 'http://localhost:8080/prueba/HelloWorld?wsdl';
//variable
var args = {arg0: 'friend'};

app.get('/', function (req, res) {

    soap.createClient(url, function(err, client) {
      client.sayHi(args, function(err, result) {
          res.send(result);
      });
    });
})

var server = app.listen(3000, function () {

  var host = server.address().address
  var port = server.address().port

  console.log('Example app listening at http://%s:%s', host, port)

})
我尝试将soap消息发送到其他Web服务,例如,我的客户机代码正常工作,所以我认为我的Web服务中有一些错误

在我的maven项目中,我刚刚在接口声明上方添加了这行代码,用于调试web服务中的消息:

@org.apache.cxf.feature.Features(features = "org.apache.cxf.feature.LoggingFeature")
通过这种方式,我获得了输入messagesoap客户端和输出messageWebService响应:

输入消息:

mar 05, 2015 1:33:08 PM org.apache.cxf.services.HelloWorldImplService.HelloWorldImplPort.HelloWorld
INFORMACIÓN: Inbound Message
----------------------------
ID: 17
Address: http://localhost:8080/prueba/HelloWorld
Encoding: UTF-8
Http-Method: POST
Content-Type: text/xml; charset=utf-8
Headers: {Accept=[text/html,application/xhtml+xml,application/xml,text/xml;q=0.9,*/*;q=0.8], accept-charset=[utf-8], accept-encoding=[none], connection=[close], Content-Length=[230], content-type=[text/xml; charset=utf-8], host=[localhost:8080], SOAPAction=[""], user-agent=[node-soap/0.8.0]}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xmlns:tns="http://prueba.prueba/"><soap:Body><sayHi><arg0>Hola</arg0></sayHi></soap:Body></soap:Envelope>
在SoapUI中,我实现了发送字符串: 这是InputMessage客户端:SoapUI

ID: 18
Address: http://localhost:8080/prueba/HelloWorld
Encoding: UTF-8
Http-Method: POST
Content-Type: text/xml;charset=UTF-8
Headers: {accept-encoding=[gzip,deflate], connection=[Keep-Alive],
Content-Length=[285], content-type=[text/xml;charset=UTF-8], host=[localhost:8080],
SOAPAction=[""], user-agent=[Apache-HttpClient/4.1.1 (java 1.5)]}
Payload: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pru="http://prueba.prueba/">
   <soapenv:Header/>
   <soapenv:Body>
      <pru:sayHi>
         <!--Optional:-->
         <arg0>"?"</arg0>
      </pru:sayHi>
   </soapenv:Body>
</soapenv:Envelope>
我不知道我做错了,我希望有人能帮助我


先谢谢你

我是现场的维护人员/合作者之一

我不知道cxf-jaxws-javafirst,但是查看您的wsdl图像,我在任何地方都找不到定义的pru:prefix,所以我不知道SoapUI在哪里假设元素应该附加这个前缀

对于我来说,节点SOAP的生成SOAP主体:


根据输入wsdl,似乎是有效的。

我是位于的维护者/合作者之一

我不知道cxf-jaxws-javafirst,但是查看您的wsdl图像,我在任何地方都找不到定义的pru:prefix,所以我不知道SoapUI在哪里假设元素应该附加这个前缀

对于我来说,节点SOAP的生成SOAP主体:


似乎有效,基于输入wsdl。

我试图从SoapUI中删除名称空间pru,但我遇到了相同的错误,因此这是我的错误,我必须获得添加名称空间的权限。Pru指的是我的wsdl的名称空间tns

我阅读了节点soap的github问题,其中一个提到了名称空间tns。

我已经更改了wsdl.js文件的以下行:

this.ignoredNamespaces= [ 'tns', 'targetNamespace', 'typedNamespace']
WSDL.prototype._ignoredSchemaNamespaces = ['tns', 'xs', 'xsd'];

我的代码也能工作


谢谢herom

我试图从SoapUI中删除名称空间pru,但我遇到了相同的错误,因此这是我的错误,我必须获得并添加名称空间。Pru指的是我的wsdl的名称空间tns

我阅读了节点soap的github问题,其中一个提到了名称空间tns。

我已经更改了wsdl.js文件的以下行:

this.ignoredNamespaces= [ 'tns', 'targetNamespace', 'typedNamespace']
WSDL.prototype._ignoredSchemaNamespaces = ['tns', 'xs', 'xsd'];

我的代码也能工作


谢谢herom

我试图从SoapUI中删除名称空间pru,但我遇到了相同的错误,因此这是我的错误。我必须获取并添加名称空间。Pru是指我的wsdl的名称空间tns。我试图从SoapUI中删除名称空间Pru,但我遇到了相同的错误,所以这是我的错误。我必须获取并添加名称空间。Pru指的是我的wsdl的名称空间tns。
<soap:Body>
  <sayHi>
    <arg0>
      Hola
    </arg0>
  </sayHi>
</soap:Body>
this.ignoredNamespaces= [ 'tns', 'targetNamespace', 'typedNamespace']
WSDL.prototype._ignoredSchemaNamespaces = ['tns', 'xs', 'xsd'];
this.ignoredNamespaces= [  'targetNamespace', 'typedNamespace']
WSDL.prototype._ignoredSchemaNamespaces = ['xs', 'xsd'];