I could’t really find a decent solution to this. In the end it was solved by building out the XML myself with this extremely messy code:
# Builds an XML Request for use with the Magento API
#-------------------------------------------------------------------------------------------------------------
# Usage:
#
# @m = MageAPI.new(token, call, params) Creates a new MageAPIRequest object with @call, @token, @data and
# @xml_data instance variables.
#
# Expects a hash of params like:
#
# { parentId: '90',
# categoryData: {
# name: 'OMG, does this work?',
# is_active: 1,
# available_sort_by: 'position',
# default_sort_by: 'position',
# description: 'Foo',
# url_key: 'url_key',
# include_in_menu: 1}
# }
#
#-------------------------------------------------------------------------------------------------------------
class MageAPIRequest
attr_reader :call, :token, :data, :xml_data
def initialize(token, call, params = {})
@call = call
@token = token
@data = params
@xml_data = build_xml
end
def to_s
return @xml_data
end
# Build out the xml string to send to the server, excluding the Envelope, body and call tags, which are added by Savon.
def build_xml
token = LibXML::XML::Node.new('sessionId', @token)
token['xsi:type']='xsd:string'
resourcePath = LibXML::XML::Node.new('resourcePath', @call)
resourcePath['xsi:type']='xsd:string'
unless @data.empty?
args = LibXML::XML::Node.new 'args'
args['SOAP-ENC:arrayType'] = "xsd:ur-type[#{@data.length}]"
args['xsi:type'] = 'SOAP-ENC:Array'
# Build the structure insude 'args', based on the Hash.
# TODO: Make this recursive, so it can work deeper than one level.
@data.each do |k,v|
if v.is_a? Hash
details = LibXML::XML::Node.new(k.to_s)
details["xsi:type"] = 'ns2:Map'
args << details
v.each do |key,value|
item_node = LibXML::XML::Node.new("item")
key_node = LibXML::XML::Node.new("key", key.to_s)
key_node['xsi:type'] = 'xsd:string'
if value.is_a? Fixnum
value_node = LibXML::XML::Node.new("value", value.to_s)
value_node['xsi:type'] = 'xsd:int'
elsif value.is_a? Float
value_node = LibXML::XML::Node.new("value", sprintf("%.2f", value))
value_node['xsi:type'] = 'xsd:string'
elsif value.is_a? Array
value_node = LibXML::XML::Node.new("value")
value_node['SOAP-ENC:arrayType'] = "xsd:int[#{value.length}]"
value_node['xsi:type'] = 'SOAP-ENC:Array'
value.each do |v|
v_node = LibXML::XML::Node.new("item", v.to_s)
v_node['xsi:type'] = 'xsd:string'
v_node['xsi:type'] = 'xsd:int' if v.is_a? Fixnum
value_node << v_node
end
else
value_node = LibXML::XML::Node.new("value", value.to_s)
value_node['xsi:type'] = 'xsd:string'
end
item_node << key_node
item_node << value_node
details << item_node
end
else
pair = LibXML::XML::Node.new(k.to_s, v.to_s)
# if v.is_a? Fixnum
# pair['xsi:type']='xsd:int'
# else
pair['xsi:type']='xsd:string'
# end
args << pair
end
end
end
xml_string = token.to_s
xml_string << resourcePath.to_s
xml_string << args.to_s
end
end
I then used that when creating my request:
request = MageAPIRequest.new(@token, call, params)
Far from ideal, but it works. It’s worth noting that I also had to build a parser to turn the responses which look like this:
{:balance=>"10",
:exchange_rate=>"1.000000",
:response_type=>"ACCEPT",
:customer_data=>
{:item=>
[
{:key=>"iredeem_member_id", :value=>"110"},
{:key=>"prefix", :value=>"Ms."},
{:key=>"lastname", :value=>"Last name"},
{:key=>"firstname", :value=>"First name"},
{:key=>"iredeem_points_balance", :value=>"10"},
]
}
}
into something useable like this:
{:balance=>"10",
:exchange_rate=>"1.000000",
:response_type=>"ACCEPT",
:customer_data=>
{:iredeem_member_id=>"110",
:prefix=>"Ms.",
:lastname=>"Last name",
:firstname=>"First name",
:iredeem_points_balance=>"10"
}
}
Содержание
- ERROR: Install-Module : A parameter cannot be found that matches parameter name ‘AllowPrerelease’. #29999
- Comments
- Document Details
ERROR: Install-Module : A parameter cannot be found that matches parameter name ‘AllowPrerelease’. #29999
Problem description:
The following command terminates with an error:
Note:
The following command executes successfully:
Tested on OS version:
Tested on Powershell version:
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 1aa8c1f7-dc55-7129-95be-687a0b11a636
- Version Independent ID: 4a09b58a-9fd2-69fc-0348-e6d4d0956a20
- Content: Planning for an Azure File Sync deployment
- Content Source: articles/storage/files/storage-sync-files-planning.md
- Service: storage
- Sub-service: files
- GitHub Login: @roygara
- Microsoft Alias: rogarana
The text was updated successfully, but these errors were encountered:
@kborovik, Thanks for your question. We are checking on this and will respond to you soon.
@kborovik, Thanks for the feedback!I have assigned the issue to the content author to investigate further and update the document as appropriate.
@kborovik Thanks for reaching out. I just tested it, it works fine if I follow the steps as-is.
Did you complete the steps prior to this one? Specifically:
Install-Module -Name PackageManagement -Repository PSGallery -Force
Install-Module -Name PowerShellGet -Repository PSGallery -Force
Then restart shell
Then enter Install-Module -Name Az.StorageSync -AllowPrerelease -AllowClobber -Force
@kborovik,We will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.
just restart the shell
It’s not possible to «restart the shell» in an unattended build script.
This is a bug in PowerShell and should be fixed.
It’s not possible to «restart the shell» in an unattended build script.
This is a bug in PowerShell and should be fixed.
If you can’t restart the shell, you should be able to, instead, re-import the module by doing Remove-Module -Name PowerShellGet and then Import-Module -Name PowerShellGet .
Keep in mind, updating the PowerShellGet module to a version that supports the -AllowPrerelease parameter is something that should only have to be done once on a system (or profile if only installed on the -CurrentProfile ). You could do this once, across the board, and any unattended build scripts would not require re-importing the PowerShellGet module.
Источник
I am using SOAP api to integrate an ERP system but throws fatal error Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Client] Error cannot find parameter
<?php
require_once(__DIR__ . '/app/Mage.php');
Mage::app();
$api_url_v2 = "https://ninobambino.in/index.php/api/v2_soap/?wsdl=1";
$username = 'test123';
$password = 'test123';
$cli = new SoapClient($api_url_v2);
//retreive session id from login
//$session_id = $cli->login($username, $password);
$session = $cli->login('test123', 'test123');
//call customer.list method
$result = $cli->customerCustomerList($session_id);
print_r($result);
asked Feb 16, 2018 at 10:26
1
Problem is when you pass session to get customer list $result = $cli->customerCustomerList($session_id);
Now change to following code:
<?php
$api_url_v2 = "https://ninobambino.in/index.php/api/v2_soap/?wsdl";
$username = 'test123';
$password = 'test123';
$cli = new SoapClient($api_url_v2);
//retreive session id from login
//$session_id = $cli->login($username, $password);
$session = $cli->login('test123', 'test123');
//call customer.list method
$result = $cli->customerCustomerList($session);
print_r($result);
answered Nov 19, 2018 at 4:47
Sohel RanaSohel Rana
34.9k3 gold badges69 silver badges85 bronze badges
Now Magento SOAP API have updated logic for get session ID using login method. Try below mentioned code.
try{
$wsdlUrl = 'https://www.yourdomain.com/api/v2_soap/?wsdl';
$client = new SoapClient($wsdlUrl);
// $sessionId = $client->login("******","******");
$auth_resp = $client->login(array("username"=>"Your username","apiKey"=>"API key"));
$sessionId = $auth_resp->result;
}catch(Exception $e){
echo '<pre>';
print_r($e);
exit;
}
echo $sessionId;exit;
answered Aug 5, 2019 at 6:35
A parameter cannot be found that matches parameter name u0027Attributesu0027. #19
Comments
eissko commented Nov 7, 2019 •
Hello Microsoft,
hitting error only first cycle when applying DSC resource xVSTSAgent in azure automation account from module of version 2.0.8. The next 2nd cycle of DSC is successfull. Here is error message:
<
«Exception»: <
«Message»: «The PowerShell DSC resource u0027[xVSTSAgent]xVSTSAgent 10u0027 with SourceInfo u0027::52::17::xVSTSAgentu0027 threw one or more non-terminating errors while running the Test-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.»,
«Data»: <
The text was updated successfully, but these errors were encountered:
eissko commented Nov 7, 2019
And this is an error from eventvwr.msc:
Job <73390701-015C-11EA-A80E-000D3AA83F09>:
This event indicates that a non-terminating error was thrown when DSCEngine was executing Test-TargetResource on xVSTSAgent DSC resource. FullyQualifiedErrorId is NamedParameterNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand. Error Message is A parameter cannot be found that matches parameter name ‘Attributes’..
eissko commented Nov 19, 2019
The error is comming from function Get-VstsAgent — line 430
Get-ChildItem «$AgentDirectory**.agent» -Attributes ‘!D+H,!D’ -ErrorAction SilentlyContinue | .
jwittner commented Nov 19, 2019
Very strange, Get-ChildItem definitely has the Attributes parameter. Even as far back as Version 3.0 of PowerShell. Can I ask what versions of PowerShell you’re using, and what your $AgentDirectory is?
eissko commented Nov 19, 2019 •
I know — that’s very strange issue. I would like to put emphasis again on the fact that only 1st cycle of DSC fails. 2nd one is allright. Here below is snippet from DSC configuration — creating volume, the folder and then installing agents in the loop. DependsON should keep the correct flow.
Источник
A parameter cannot be found that matches parameter name u0027Attributesu0027. #19
Comments
eissko commented Nov 7, 2019 •
Hello Microsoft,
hitting error only first cycle when applying DSC resource xVSTSAgent in azure automation account from module of version 2.0.8. The next 2nd cycle of DSC is successfull. Here is error message:
<
«Exception»: <
«Message»: «The PowerShell DSC resource u0027[xVSTSAgent]xVSTSAgent 10u0027 with SourceInfo u0027::52::17::xVSTSAgentu0027 threw one or more non-terminating errors while running the Test-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.»,
«Data»: <
The text was updated successfully, but these errors were encountered:
eissko commented Nov 7, 2019
And this is an error from eventvwr.msc:
Job <73390701-015C-11EA-A80E-000D3AA83F09>:
This event indicates that a non-terminating error was thrown when DSCEngine was executing Test-TargetResource on xVSTSAgent DSC resource. FullyQualifiedErrorId is NamedParameterNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand. Error Message is A parameter cannot be found that matches parameter name ‘Attributes’..
eissko commented Nov 19, 2019
The error is comming from function Get-VstsAgent — line 430
Get-ChildItem «$AgentDirectory**.agent» -Attributes ‘!D+H,!D’ -ErrorAction SilentlyContinue | .
jwittner commented Nov 19, 2019
Very strange, Get-ChildItem definitely has the Attributes parameter. Even as far back as Version 3.0 of PowerShell. Can I ask what versions of PowerShell you’re using, and what your $AgentDirectory is?
eissko commented Nov 19, 2019 •
I know — that’s very strange issue. I would like to put emphasis again on the fact that only 1st cycle of DSC fails. 2nd one is allright. Here below is snippet from DSC configuration — creating volume, the folder and then installing agents in the loop. DependsON should keep the correct flow.
Источник
Can’t install NuGet package through PowerShell #21
Comments
xhevahir commented Mar 12, 2019
Hi,
I’m trying to install using the NuGet instructions, and Powershell gives this error:
Install-Package : A parameter cannot be found that matches parameter name ‘Version’.
At line:1 char:44
- CategoryInfo : InvalidArgument: (:) [Install-Package], ParameterBindingException
- FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
I’m new to .NET, so maybe I’m missing something obvious.
The text was updated successfully, but these errors were encountered:
melanchall commented Mar 12, 2019 •
Please note that Install-Package with -Version parameter is a command for NuGet Package Manager Console inside Visual Studio. It’s not a command for PowerShell.
PowerShell’s Install-Package has not -Version parameter. Try to remove -Version 4.0.0 and run command again.
Is it an option to install package for your project with Visual Studio? Or you must do it via PowerShell only?
xhevahir commented Mar 13, 2019
That worked! Thanks a lot for helping a newbie.
ajnair100 commented Jan 9, 2020
am still facing the issue am unable to install SMO 14 for sql 2017 for me to run my Avamar backup which needs these Smo14
how can I do this ? any idea is it powershell script or Nuget or what should be done to get these SMo14 for sql 2017??
the above command PS fails ..
Footer
© 2023 GitHub, Inc.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Источник
Can’t install NuGet package through PowerShell #21
Comments
xhevahir commented Mar 12, 2019
Hi,
I’m trying to install using the NuGet instructions, and Powershell gives this error:
Install-Package : A parameter cannot be found that matches parameter name ‘Version’.
At line:1 char:44
- CategoryInfo : InvalidArgument: (:) [Install-Package], ParameterBindingException
- FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
I’m new to .NET, so maybe I’m missing something obvious.
The text was updated successfully, but these errors were encountered:
melanchall commented Mar 12, 2019 •
Please note that Install-Package with -Version parameter is a command for NuGet Package Manager Console inside Visual Studio. It’s not a command for PowerShell.
PowerShell’s Install-Package has not -Version parameter. Try to remove -Version 4.0.0 and run command again.
Is it an option to install package for your project with Visual Studio? Or you must do it via PowerShell only?
xhevahir commented Mar 13, 2019
That worked! Thanks a lot for helping a newbie.
ajnair100 commented Jan 9, 2020
am still facing the issue am unable to install SMO 14 for sql 2017 for me to run my Avamar backup which needs these Smo14
how can I do this ? any idea is it powershell script or Nuget or what should be done to get these SMo14 for sql 2017??
the above command PS fails ..
Footer
© 2023 GitHub, Inc.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Источник
ERROR: Install-Module : A parameter cannot be found that matches parameter name ‘AllowPrerelease’. #29999
Comments
kborovyk commented Apr 24, 2019 •
Problem description:
The following command terminates with an error:
Note:
The following command executes successfully:
Tested on OS version:
Tested on Powershell version:
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 1aa8c1f7-dc55-7129-95be-687a0b11a636
- Version Independent ID: 4a09b58a-9fd2-69fc-0348-e6d4d0956a20
- Content: Planning for an Azure File Sync deployment
- Content Source: articles/storage/files/storage-sync-files-planning.md
- Service: storage
- Sub-service: files
- GitHub Login: @roygara
- Microsoft Alias: rogarana
The text was updated successfully, but these errors were encountered:
YASWANTHM-MSFT commented Apr 24, 2019
@kborovik, Thanks for your question. We are checking on this and will respond to you soon.
YASWANTHM-MSFT commented Apr 25, 2019
@kborovik, Thanks for the feedback!I have assigned the issue to the content author to investigate further and update the document as appropriate.
roygara commented Apr 25, 2019
@kborovik Thanks for reaching out. I just tested it, it works fine if I follow the steps as-is.
Did you complete the steps prior to this one? Specifically:
Install-Module -Name PackageManagement -Repository PSGallery -Force
Install-Module -Name PowerShellGet -Repository PSGallery -Force
Then restart shell
Then enter Install-Module -Name Az.StorageSync -AllowPrerelease -AllowClobber -Force
YASWANTHM-MSFT commented Apr 26, 2019
@kborovik,We will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.
Mnabawy commented Feb 24, 2021
just restart the shell
peter-bertok commented Jan 24, 2022
It’s not possible to «restart the shell» in an unattended build script.
This is a bug in PowerShell and should be fixed.
jessiewestlake commented Mar 22, 2022 •
It’s not possible to «restart the shell» in an unattended build script.
This is a bug in PowerShell and should be fixed.
If you can’t restart the shell, you should be able to, instead, re-import the module by doing Remove-Module -Name PowerShellGet and then Import-Module -Name PowerShellGet .
Keep in mind, updating the PowerShellGet module to a version that supports the -AllowPrerelease parameter is something that should only have to be done once on a system (or profile if only installed on the -CurrentProfile ). You could do this once, across the board, and any unattended build scripts would not require re-importing the PowerShellGet module.
Источник
Description
trax was working great for me a month ago, but now I can no longer import it due to this error. Any help would be greatly appreciated, thank you!
Environment information
OS: Ubuntu 20.04
$ pip freeze | grep tensor
mesh-tensorflow==0.1.13
tensor2tensor==1.15.5
tensorboard==2.2.1
tensorboard-plugin-wit==1.6.0.post3
tensorflow==2.2.0
tensorflow-datasets==3.1.0
tensorflow-estimator==2.2.0
tensorflow-gan==2.0.0
tensorflow-gpu==2.2.0
tensorflow-hub==0.8.0
tensorflow-metadata==0.21.2
tensorflow-probability==0.7.0
tensorflow-text==2.2.1
$ pip freeze | grep jax
jax==0.1.65
jaxlib==0.1.45
$ python -V
Python 3.8.2
For bugs: reproduction and error logs
# Steps to reproduce:
import trax
# Error logs:
Traceback (most recent call last):
File "/home/tom/.local/lib/python3.8/site-packages/trax/tf_numpy/numpy/__init__.py", line 27, in <module>
from tensorflow.python.ops.numpy_ops import *
ModuleNotFoundError: No module named 'tensorflow.python.ops.numpy_ops'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "tf_nfl_reformer.py", line 3, in <module>
import trax
File "/home/tom/.local/lib/python3.8/site-packages/trax/__init__.py", line 18, in <module>
from trax import layers
File "/home/tom/.local/lib/python3.8/site-packages/trax/layers/__init__.py", line 23, in <module>
from trax.layers.activation_fns import *
File "/home/tom/.local/lib/python3.8/site-packages/trax/layers/activation_fns.py", line 26, in <module>
from trax import math
File "/home/tom/.local/lib/python3.8/site-packages/trax/math/__init__.py", line 20, in <module>
from trax.math import tf as tf_math
File "/home/tom/.local/lib/python3.8/site-packages/trax/math/tf.py", line 26, in <module>
from trax.tf_numpy import extensions as tf_np_extensions
File "/home/tom/.local/lib/python3.8/site-packages/trax/tf_numpy/extensions/__init__.py", line 23, in <module>
from trax.tf_numpy.extensions.extensions import *
File "/home/tom/.local/lib/python3.8/site-packages/trax/tf_numpy/extensions/extensions.py", line 30, in <module>
import trax.tf_numpy.numpy as tf_np
File "/home/tom/.local/lib/python3.8/site-packages/trax/tf_numpy/numpy/__init__.py", line 39, in <module>
from trax.tf_numpy.numpy_impl.math_ops import *
File "/home/tom/.local/lib/python3.8/site-packages/trax/tf_numpy/numpy_impl/math_ops.py", line 1126, in <module>
def meshgrid(*xi, **kwargs):
File "/home/tom/.local/lib/python3.8/site-packages/trax/tf_numpy/numpy_impl/utils.py", line 217, in decorator
raise TypeError('Cannot find parameter "%s" in the numpy function's '
TypeError: Cannot find parameter "kwargs" in the numpy function's signature
проверка данных
Я пытаюсь создать категорию через API Magento SOAP, используя мыло. Прежде чем кто-либо предложит это, я не могу использовать Magento SOAP v2 или REST API.
Этот код настраивает мой клиент и входит в систему:
@client = Savon.client(wsdl: "#{EnvConfig.base_url}/api/soap/?wsdl", log_level: :debug, raise_errors: true, pretty_print_xml: true)
response = @client.call(:login, message: {
username: EnvConfig.magento_api_user,
apiKey: EnvConfig.magento_api_key
})
@token = response.to_hash[:login_response][:login_return]
Затем я могу вызывать различные методы magentos. К перечислить все продукты, Я могу позвонить:
@response = @client.call(:call, message: {session: @token, method: 'catalog_product.list'})
Все это работает правильно, так что, кажется, нет проблем ни с одним из приведенных выше кодов.
Проблема
Когда я звоню catalog_category.create, я получаю сообщение об ошибке. Если я вызову метод только с параметром parentID:
@response = @client.call(:call, message: {session: @token, method: 'catalog_category.create', parent_id: 90})
затем Savon отправляет следующий XML:
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:typens="urn:Magento" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<typens:call>
<session>6939ace91ba26b1da9a21334d7ef2c13</session>
<method>catalog_category.create</method>
<parentId>90</parentId>
</typens:call>
</env:Body>
</env:Envelope>
Это возвращает ответ Savon::SOAPFault: (103) Attribute "name" is required
:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>103</faultcode>
<faultstring>Attribute "name" is required.</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Я ожидал этого, поскольку документация по API поясняет, что следующие атрибуты не являются необязательными:
- идентификатор родителя
- категорияДанные
- имя
- is_active
- available_sort_by
- default_sort_by
- include_in_menu
Итак, если я сделаю вызов, содержащий name
:
@response = @client.call(:call, message: {session: @token, method: 'catalog_category.create', parent_id: 90, category_data: {name: 'Fooooo'}})
Этот XML отправляется:
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:typens="urn:Magento" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<typens:call>
<session>6939ace91ba26b1da9a21334d7ef2c13</session>
<method>catalog_category.create</method>
<parentId>90</parentId>
<categoryData>
<name>Fooooo</name>
</categoryData>
</typens:call>
</env:Body>
</env:Envelope>
Но я получаю Savon::SOAPFault: (SOAP-ENV:Client) Error cannot find parameter
ошибка:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>Error cannot find parameter</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Я потратил довольно много времени, пытаясь решить это, и попытался отправить name
параметр, не оборачивая его в categoryData, а также другие параметры. Все возвращают одно и то же сообщение об ошибке.
По крайней мере, хорошо бы знать который параметр не найден!
Любая помощь будет оценена по достоинству
Good morning to everyone:
I’m having trouble with a webservice made in php5 (5.2.6) and SOAP module (not nuSoap). I´m sending the request, but I’m not receiving any information back. Could be some kind of error in the WSDL or am I calling the function in a wrong way?
// WEBSERVICES.PHP
// function
function swbas_cliente ( $entrada, $entrada2 ) {
$resultado = "This is entrada: ".$entrada." and this entrada2: ".$entrada2;
return $resultado;
}
$server = new SoapServer("http://srv-web/basterra/merkagest/webservices/basterra.xml");
$server->addFunction("swbas_cliente");
$server->handle();
// CLIENT.PHP
$cliente = array ("entrada" => "first parameter", "entrada2" => "second parameter");
$array_options = array(
"trace" => true,
"exceptions" => true,
"connection_timeout" => 30,
"cache_wsdl" => 0,
"encoding" => 'utf-8',
"features" => SOAP_SINGLE_ELEMENT_ARRAYS,
"location" => http://srv-web/basterra/merkagest/webservices/webservices.php,
"uri" => urn:merkagest:basterra
);
$client = new SoapClient(CFG_MKGEST_PATH, $array_options);
$result = $client->__soapCall( "swbas_cliente", array($params) );
Open in new window
Request:
nHeadersRequest :nPOST /basterra/merkagest/webservices/webservices.php HTTP/1.1
Host: srv-web
Connection: Keep-Alive
User-Agent: PHP-SOAP/5.2.6-1+lenny8
Content-Type: text/xml; charset=utf-8
SOAPAction: "swbas_cliente"
Content-Length: 344
nRequest :n<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:merkagest:basterra"><SOAP-ENV:Body><ns1:swbas_clienteRequest><ns1:entrada>first parameter</ns1:entrada><ns1:entrada2>second parameter</ns1:entrada2></ns1:swbas_clienteRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>
Open in new window
Response:
nHeadersResponse :nHTTP/1.1 200 OK
Date: Thu, 08 Jul 2010 10:06:56 GMT
Server: Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny8 with Suhosin-Patch mod_python/3.3.1 Python/2.5.2 mod_ssl/2.2.9 OpenSSL/0.9.8g mod_perl/2.0.4 Perl/v5.10.0
X-Powered-By: PHP/5.2.6-1+lenny8
Content-Length: 232
Vary: Accept-Encoding
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/xml; charset=utf-8
nResponse:n<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:merkagest:basterra"><SOAP-ENV:Body><ns1:swbas_clienteResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
n
Open in new window
The WSDL is:
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="basterra" targetNamespace="urn:merkagest:basterra"
xmlns:tns="urn:merkagest:basterra"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:S1="urn:soap-fault:details"
xmlns:S2="urn:merkagest:basterra"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<!-- definition of types used in WSDL-->
<types>
<xsd:schema elementFormDefault="unqualified" targetNamespace="urn:soap-fault:details" xmlns="http://www.w3.org/2001/XMLSchema">
<xsd:element name="FaultDetail">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="errorMessage" type="string" />
<xsd:element name="requestID" type="string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<schema elementFormDefault="qualified" targetNamespace="urn:merkagest:basterra" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="swbas_productoRequest">
<complexType>
<sequence>
<element name="TipoOperacion" nillable="true" type="xsd:string"/>
<element name="Articulo_id" nillable="true" type="xsd:int"/>
<element name="Desc_art" nillable="true" type="xsd:string"/>
<element name="Pvent_art" nillable="true" type="xsd:float"/>
<element name="proIVA" nillable="true" type="xsd:float"/>
<element name="Fechalta_art" nillable="true" type="xsd:date"/>
<element name="Aux3_id" nillable="true" type="xsd:int"/>
<element name="desc_aux3" nillable="true" type="xsd:string"/>
<element name="Aux4_id" nillable="true" type="xsd:int"/>
<element name="desc_aux4" nillable="true" type="xsd:string"/>
<element name="Aux5_id" nillable="true" type="xsd:int"/>
<element name="desc_aux5" nillable="true" type="xsd:string"/>
<element name="Aux6_id" nillable="true" type="xsd:int"/>
<element name="desc_aux6" nillable="true" type="xsd:string"/>
<element name="codpro_art" nillable="true" type="xsd:int"/>
<element name="piecajv_art" nillable="true" type="xsd:int"/>
<element name="ampliatec_art" nillable="true" type="xsd:string"/>
<element name="modComImp" nillable="true" type="xsd:float"/>
<element name="b2b_art" nillable="true" type="xsd:int"/>
<element name="proPeso" nillable="true" type="xsd:float"/>
<element name="proTipoPorte" nillable="true" type="xsd:int"/>
</sequence>
</complexType>
</element>
<element name="swbas_productoResponse">
<complexType>
<sequence>
<element name="resultado" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="swbas_clienteRequest">
<complexType>
<sequence>
<element name="entrada" type="xsd:string"/>
<element name="entrada2" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="swbas_clienteResponse">
<complexType>
<sequence>
<element name="resultado" type="xsd:string"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<!--abstract definition of the data being transmitted-->
<message name="swbas_productoRequest">
<part name="parameters" element="S2:swbas_productoRequest"/>
</message>
<message name="swbas_productoResponse">
<part name="parameters" element="S2:swbas_productoResponse"/>
</message>
<message name="swbas_clienteRequest">
<part name="parameters" element="S2:swbas_clienteRequest"/>
</message>
<message name="swbas_clienteResponse">
<part name="parameters" element="S2:swbas_clienteResponse"/>
</message>
<message name="FaultDetailMessage">
<part name="FaultDetail" element="S1:FaultDetail"/>
</message>
<!-- a set of abstract operations referring to input and output messages -->
<portType name="basterraObj">
<operation name="swbas_producto">
<input message="tns:swbas_productoRequest"/>
<output message="tns:swbas_productoResponse"/>
<fault name="basterraFault" message="tns:FaultDetailMessage"/>
</operation>
<operation name="swbas_cliente">
<input message="tns:swbas_clienteRequest"/>
<output message="tns:swbas_clienteResponse"/>
<fault name="basterraFault" message="tns:FaultDetailMessage"/>
</operation>
</portType>
<!-- concrete protocol and data format specs -->
<binding name="basterraObj" type="tns:basterraObj">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="swbas_producto">
<soap:operation soapAction="swbas_producto" style="document"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
<fault name="basterraFault">
<soap:fault name="basterraFault" use="literal"/>
</fault>
</operation>
<operation name="swbas_cliente">
<soap:operation soapAction="swbas_cliente" style="document"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
<fault name="basterraFault">
<soap:fault name="basterraFault" use="literal"/>
</fault>
</operation>
</binding>
<!-- specifies locations and bindings for a service -->
<service name="basterraService">
<documentation>Fichero WSDL para Basterra</documentation>
<port name="basterraObj" binding="tns:basterraObj">
<soap:address location="http://212.34.152.158/merkagest/webservices/webservices.php"/>
<documentation/>
</port>
</service>
</definitions>
Open in new window
I hope someone can give me a clue on this subject. I’ve been stuck for a week with this.
Thanks in advance!!!!